/* Likeness: a photo feed that doesn't exist. Its own wordmark, icons and gilt accent; no real app's marks. */
:root {
  --bg: #ffffff; --page: #f4f2ee; --fg: #111010; --muted: #6f6a64; --line: #e3dfd8; --soft: #f3f0eb;
  --accent: #b08a45; --accent-ink: #1d1407; --like: #e0314b; --mention: #2f5896; --warn: #b3261e; --up: #1f7a4d;
  --sheet: #ffffff; --shadow: 0 12px 40px rgba(20, 14, 8, .18);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0b0a; --page: #070606; --fg: #f1ede6; --muted: #9d968d; --line: #2a2622; --soft: #1a1714;
    --accent: #c9a25b; --accent-ink: #1d1407; --like: #ff4d64; --mention: #a8c3ee; --warn: #ff8a80; --up: #5fd39a;
    --sheet: #151311; --shadow: 0 12px 40px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0b0a; --page: #070606; --fg: #f1ede6; --muted: #9d968d; --line: #2a2622; --soft: #1a1714;
  --accent: #c9a25b; --accent-ink: #1d1407; --like: #ff4d64; --mention: #a8c3ee; --warn: #ff8a80; --up: #5fd39a;
  --sheet: #151311; --shadow: 0 12px 40px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--fg); font: 14px/1.4 var(--sans); }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; }
svg { width: 24px; height: 24px; }
.muted { color: var(--muted); }
.mention { color: var(--mention); text-decoration: none; }
b { font-weight: 600; }

.app { max-width: 470px; margin: 0 auto; background: var(--bg); min-height: 100vh; border-inline: 1px solid var(--line); }
@media (max-width: 471px) { .app { border-inline: 0; } }

/* ---------- the top bar ---------- */
.bar { position: sticky; top: 0; z-index: 20; height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.bar-brand { flex: 1; min-width: 0; transition: opacity .2s, transform .2s; }
.wordmark { font: italic 30px/1 var(--serif); letter-spacing: .2px; }
.bar-mini { position: absolute; left: 12px; right: 100px; top: 0; height: 56px; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; text-align: left;
  cursor: pointer; opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .2s, transform .2s; }
.bar.is-mini .bar-brand { opacity: 0; transform: translateY(-6px); }
.bar.is-mini .bar-mini { opacity: 1; transform: none; pointer-events: auto; }
.mini-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--soft); flex: none; }
.mini-text { display: flex; flex-direction: column; min-width: 0; }
.mini-handle { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-count #miniCount { color: var(--fg); font-weight: 600; }
.mini-delta { font-weight: 600; margin-left: 2px; opacity: 0; transition: opacity .3s; }
.mini-delta.up { color: var(--up); opacity: 1; }
.mini-delta.down { color: var(--warn); opacity: 1; }
.bar-actions { display: flex; margin-left: auto; }
.icon-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; border-radius: 50%; cursor: pointer; }
.icon-btn:hover { background: var(--soft); }
.icon-btn .dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--like); border: 2px solid var(--bg); }
.icon-btn .dot[hidden] { display: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- the profile ---------- */
.profile { padding: 16px 16px 0; }
.profile-top { display: flex; align-items: center; gap: 24px; }
.avatar-ring { flex: none; width: 92px; height: 92px; padding: 3px; border-radius: 50%; border: 0; cursor: pointer;
  background: conic-gradient(from 210deg, #7a5a24, #e6c679, #a67c35, #f3dc9c, #7a5a24); }
.avatar-ring img { width: 86px; height: 86px; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg); background: var(--soft); }
.stats { flex: 1; display: flex; justify-content: space-around; text-align: center; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-size: 17px; font-variant-numeric: tabular-nums; }
.stats span { color: var(--fg); font-size: 13px; }
.bio { margin-top: 12px; }
.bio-name { font-weight: 600; }
.bio-cat { color: var(--muted); }
.bio-lines div { white-space: pre-wrap; }
.bio-link { display: inline-block; color: var(--mention); font-weight: 600; text-decoration: none; }
.bio-link:hover { text-decoration: underline; }
.bio-followed { color: var(--muted); font-size: 13px; margin-top: 4px; }
.bio-followed b { color: var(--fg); }
.profile-actions { display: flex; gap: 6px; margin-top: 14px; }
.btn { flex: 1; height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--soft); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.btn:hover { filter: brightness(.96); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary.is-following { background: var(--soft); color: var(--fg); }
.btn-sit { flex: .9; }
.btn-quiet { background: none; color: var(--mention); flex: none; }
.highlights { display: flex; gap: 16px; margin: 16px -16px 0; padding: 0 16px 4px; overflow-x: auto; scrollbar-width: none; }
.hl { flex: none; width: 84px; background: none; border: 0; padding: 0; cursor: pointer; text-align: center; }
.hl img { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg); outline: 1px solid var(--line); outline-offset: 1px; background: #000; }
.hl span { display: block; margin-top: 6px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; margin: 12px -16px 0; border-top: 1px solid var(--line); }
.tab { flex: 1; height: 44px; display: grid; place-items: center; background: none; border: 0; border-bottom: 1px solid transparent; color: var(--muted); cursor: pointer; }
.tab.is-on { color: var(--fg); border-bottom-color: var(--fg); }

.sitter-note { margin: 0; padding: 10px 16px; background: var(--soft); border-bottom: 1px solid var(--line); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.sitter-note[hidden] { display: none; }
.sitter-note span { flex: 1; }

/* ---------- a post ---------- */
.post { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 10px 4px 10px 12px; }
.post-head img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--soft); }
.post-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.post-who .handle { font-weight: 600; }
.post-who .loc { font-size: 12px; color: var(--fg); }
.pin { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); }
.pin svg { width: 16px; height: 16px; }
.post-media { position: relative; aspect-ratio: 4 / 5; background: #050403; overflow: hidden; user-select: none; -webkit-user-select: none; }
.post-media img { width: 100%; height: 100%; object-fit: cover; transition: filter .35s; }
.post-media.is-veiled img { filter: blur(34px) brightness(.7); transform: scale(1.1); }
.veil { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; text-align: center; color: #fff; }
.veil svg { width: 40px; height: 40px; }
.veil b { font-size: 16px; }
.veil p { margin: 0; max-width: 260px; font-size: 13px; color: #e6e0d8; }
.veil button { margin-top: 12px; width: 100%; max-width: 300px; height: 44px; background: none; border: 0; border-top: 1px solid rgba(255, 255, 255, .35); color: #fff; font-weight: 600; cursor: pointer; }
.burst { position: absolute; left: 50%; top: 50%; width: 110px; height: 110px; margin: -55px 0 0 -55px; color: #fff; opacity: 0; transform: scale(.3); pointer-events: none; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .45)); }
.burst svg { width: 100%; height: 100%; }
.burst.go { animation: burst .9s ease-out; }
@keyframes burst { 0% { opacity: 0; transform: scale(.3); } 15% { opacity: 1; transform: scale(1.15); } 30% { transform: scale(.95); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }
.post-actions { display: flex; align-items: center; padding: 4px 4px 0; }
.post-actions .spacer { flex: 1; }
.like-btn.is-on { color: var(--like); }
.like-btn.is-on svg { animation: pop .35s ease-out; }
@keyframes pop { 50% { transform: scale(1.25); } }
.post-body { padding: 0 16px; }
.post-likes { font-weight: 600; font-variant-numeric: tabular-nums; }
.post-likes .by { font-weight: 400; }
.post-likes .by b { font-weight: 600; }
.post-caption { margin-top: 4px; }
.post-caption .handle { font-weight: 600; margin-right: 4px; }
.source-btn { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; padding: 3px 10px 3px 7px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted); font-size: 12px; cursor: pointer; }
.source-btn svg { width: 15px; height: 15px; }
.source-btn[aria-expanded="true"] { color: var(--fg); border-color: var(--accent); }
.source { margin-top: 8px; padding: 10px 12px; border-left: 2px solid var(--accent); background: var(--soft); border-radius: 0 8px 8px 0; }
.source[hidden] { display: none; }
.source blockquote { margin: 0; font: 17px/1.35 var(--serif); }
.source blockquote + .cite { margin-bottom: 10px; }
.source blockquote + .cite:last-child { margin-bottom: 0; }
.source .cite { display: block; margin-top: 4px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.view-all { margin-top: 6px; color: var(--muted); }
.comments { list-style: none; margin: 4px 0 0; padding: 0; }
.comments .replies { list-style: none; margin: 0; padding: 0 0 0 30px; }
.c { display: flex; gap: 10px; padding: 3px 0; align-items: flex-start; }
.c-av { display: none; }
.post.is-open .c { padding: 7px 0; }
.post.is-open .c-av { display: grid; flex: none; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 11px; font-weight: 700; color: #fff; }
.post.is-open .c-av img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.c-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.c-main .handle { font-weight: 600; margin-right: 4px; }
.c-main .badge { display: inline-block; margin-right: 4px; padding: 0 5px; border-radius: 4px; font-size: 10px; line-height: 16px; color: var(--muted); border: 1px solid var(--line); vertical-align: 1px; }
.c-meta { display: none; gap: 12px; margin-top: 2px; font-size: 12px; color: var(--muted); }
.post.is-open .c-meta { display: flex; }
.c-like { flex: none; width: 28px; height: 28px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: pointer; }
.c-like svg { width: 13px; height: 13px; }
.c-like.is-on { color: var(--like); }
.post-time { display: block; margin-top: 8px; font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.post.is-final .comments { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 4px; }

.gap { display: flex; align-items: center; gap: 12px; padding: 34px 16px; color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.gap::before, .gap::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- the grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.grid[hidden] { display: none; }
.grid button { position: relative; padding: 0; border: 0; aspect-ratio: 4 / 5; background: #050403; cursor: pointer; overflow: hidden; }
.grid img { width: 100%; height: 100%; object-fit: cover; }
.grid .g-pin { position: absolute; top: 6px; right: 6px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .7)); }
.grid .g-pin svg { width: 18px; height: 18px; }
.grid .g-time { position: absolute; left: 6px; bottom: 5px; color: #fff; font-size: 11px; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
.grid .is-veiled img { filter: blur(16px) brightness(.7); transform: scale(1.1); }

/* ---------- the end ---------- */
.end { padding: 40px 24px 56px; text-align: center; }
.end-check { width: 56px; height: 56px; color: var(--accent); }
.end-title { margin-top: 8px; font-size: 18px; font-weight: 600; }
.end-sub { color: var(--muted); }
.end-cta { margin: 28px auto 0; max-width: 320px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.end-cta p { margin: 0 0 12px; font: 20px/1.25 var(--serif); }
.end-cta .btn { width: 100%; }
.colophon { margin: 28px auto 0; max-width: 360px; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ---------- sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .55); }
.sheet[hidden] { display: none; }
.sheet-panel { width: 100%; max-width: 470px; max-height: 86vh; overflow: auto; background: var(--sheet); border-radius: 16px 16px 0 0; box-shadow: var(--shadow); animation: up .22s ease-out; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-panel { border-radius: 14px; max-width: 420px; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet-head { position: sticky; top: 0; display: flex; align-items: center; padding: 6px 6px 6px 16px; background: var(--sheet); border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; margin: 0; font-size: 16px; }
.notifs { list-style: none; margin: 0; padding: 6px 0; }
.notifs li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.notifs li.is-new { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.notifs .n-av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.notifs .n-av img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.notifs .n-text { flex: 1; }
.notifs .n-ago { color: var(--muted); margin-left: 4px; }
.msg-empty { padding: 28px 24px 34px; text-align: center; }
.msg-empty svg { width: 44px; height: 44px; color: var(--muted); }
.msg-empty p { margin: 8px 0 0; }
.sit-body { padding: 16px; }
.sit-body p { margin: 0 0 10px; }
.sit-actions { display: flex; gap: 8px; margin-top: 14px; }
.sit-actions[hidden] { display: none; }
.sit-cam { position: relative; margin-top: 12px; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: #000; }
.sit-cam[hidden] { display: none; }
.sit-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.sit-oval { position: absolute; left: 22%; right: 22%; top: 14%; height: 52%; border: 2px dashed rgba(255, 255, 255, .6); border-radius: 50%; }
.sit-status { min-height: 1.4em; margin: 12px 0 0 !important; color: var(--muted); }
.sit-status.is-bad { color: var(--warn); }
.sit-body #restoreBtn { margin-top: 6px; padding: 0; }
.sit-body #restoreBtn[hidden] { display: none; }

/* ---------- stories ---------- */
.story { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; display: flex; align-items: center; justify-content: center; }
.story[hidden] { display: none; }
.story-img { width: 100%; height: 100%; max-width: calc(100vh * 9 / 16); object-fit: cover; }
.story-bars { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(100% - 16px, calc(100vh * 9 / 16) - 16px); display: flex; gap: 4px; z-index: 2; }
.story-bars span { flex: 1; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.story-bars i { display: block; height: 100%; width: 0; background: #fff; }
.story-head { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 10px); left: 50%; transform: translateX(-50%); width: min(100% - 16px, calc(100vh * 9 / 16) - 16px); display: flex; align-items: center; gap: 8px; z-index: 3; font-size: 13px; }
.story-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.story-name { font-weight: 600; }
.story-title { color: #d8d2ca; }
.story-close { margin-left: auto; color: #fff; }
.story-close:hover { background: rgba(255, 255, 255, .12); }
.story-text { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); width: min(100% - 48px, calc(100vh * 9 / 16) - 48px); text-align: center; z-index: 2;
  font: 22px/1.3 var(--sans); font-weight: 600; text-shadow: 0 2px 14px rgba(0, 0, 0, .9); }
.story-text .cite { display: block; margin-top: 10px; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: #d8d2ca; }
.story-tap { position: absolute; top: 80px; bottom: 0; width: 40%; background: none; border: 0; cursor: pointer; z-index: 1; }
.story-prev { left: 0; } .story-next { right: 0; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 45; max-width: min(440px, calc(100% - 32px)); padding: 12px 16px; border-radius: 12px;
  background: #1c1916; color: #f1ede6; box-shadow: var(--shadow); font-size: 13px; display: flex; gap: 10px; align-items: center; animation: up .25s ease-out; }
.toast[hidden] { display: none; }
.toast img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }

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

/* ---------- beside the feed, on wide screens ---------- */
.aside { display: none; }
@media (min-width: 1100px) {
  .aside { display: block; position: fixed; top: 88px; left: calc(50% + 235px + 40px); width: 290px; color: var(--muted); font-size: 13px; line-height: 1.5; }
  .aside p { margin: 0 0 10px; }
  .aside .aside-kicker { font: italic 22px/1.2 var(--serif); color: var(--fg); }
  .aside ul { margin: 12px 0 0; padding: 0 0 0 16px; }
  .aside li { margin-bottom: 6px; }
  .aside b { color: var(--fg); }
}
