/* r7zxn.cc. Dark by default, light follows the OS unless the toggle says otherwise. */
@font-face { font-family: 'Geist'; src: url('/fonts/geist-latin.woff2') format('woff2'); font-weight: 400 600; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist'; src: url('/fonts/geist-latin-ext.woff2') format('woff2'); font-weight: 400 600; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist Mono'; src: url('/fonts/geist-mono-latin.woff2') format('woff2'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'Geist Fallback'; src: local('Arial'); size-adjust: 103%; ascent-override: 92%; descent-override: 24%; line-gap-override: 0%; }

:root {
  color-scheme: dark;
  --bg: #0c0c0c;
  --surface: #121212;
  --text: #ededed;
  --soft: #a3a3a3;
  --faint: #858585;
  --line: #1f1f1f;
  --hover: #151515;
  --accent: #88d4a8;
  --warm: #e8b48a;
  --red: #f08a7e;

  --sans: 'Geist', 'Geist Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --step--1: .8125rem;
  --step-0: clamp(.9375rem, .9rem + .2vw, 1rem);
  --step-1: clamp(1.0625rem, 1rem + .35vw, 1.1875rem);
  --step-3: clamp(1.875rem, 1.45rem + 1.8vw, 2.5rem);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { color-scheme: light; --bg: #fbfaf7; --surface: #f4f2ec; --text: #171717; --soft: #4f4f4f; --faint: #6b6b6b; --line: #e6e3dc; --hover: #f0ede6; --accent: #1d6b45; --warm: #9a4f1c; --red: #b23a2c; }
}
:root[data-theme="light"] { color-scheme: light; --bg: #fbfaf7; --surface: #f4f2ec; --text: #171717; --soft: #4f4f4f; --faint: #6b6b6b; --line: #e6e3dc; --hover: #f0ede6; --accent: #1d6b45; --warm: #9a4f1c; --red: #b23a2c; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--line) transparent; caret-color: var(--accent); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--step-0)/1.6 var(--sans); letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, p, ol, ul, dl, dd { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
code { font: .9em var(--mono); }
::selection { background: color-mix(in srgb, #a78bfa 45%, var(--accent)); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 40px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 1em; height: 1em; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 30; padding: 8px 14px; border-radius: 8px; background: var(--text); color: var(--bg); }
.skip:focus { top: 12px; }

.col { width: min(680px, 100% - 32px); margin-inline: auto; }

/* the page is a fixed frame: bar + tabs stay put, only the open tab scrolls,
   and it fades out at the edges instead of running under the bar */
html, body { height: 100%; }
body { overflow: hidden; }
.frame { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.top { flex: none; padding-top: 24px; }
.scroller {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scroll-behavior: smooth; scrollbar-width: thin; scrollbar-gutter: stable both-edges;
  --fade-top: 28px; --fade-bottom: 72px;
  mask-image: linear-gradient(to bottom, transparent, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent);
}
.scroller:focus { outline: none; }
@media (max-width: 720px) { .scroller { scrollbar-gutter: auto; scrollbar-width: none; } }
.page { padding-block: 8px 120px; }
.panel { padding-top: 24px; }
.lead { margin-bottom: 4px; }
#apps .rows { margin-top: 24px; }

/* tabs: plain words, a quiet pill slides under the open one */
.tabs { position: relative; display: flex; gap: 2px; margin: 16px 0 0 -12px; font-size: .9375rem; }
.tab { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; color: var(--faint); transition: color .2s; }
.tab:hover { color: var(--soft); }
.tab[aria-current="page"] { color: var(--text); }
.tab .count { margin: 0; font-size: .75rem; color: var(--faint); }
.tab-pill { position: absolute; left: 0; top: 0; height: 36px; width: 0; border-radius: 999px; background: var(--hover); border: 1px solid var(--line); opacity: 0; }
.tab-pill.ready { opacity: 1; transition: transform .45s var(--ease), width .45s var(--ease); }
.block { margin-top: clamp(64px, 10vw, 96px); }
.label { font-size: var(--step--1); font-weight: 500; color: var(--faint); letter-spacing: 0; margin-bottom: 18px; }
.count { font-variant-numeric: tabular-nums; margin-left: 4px; }
.prose { max-width: 36em; color: var(--soft); text-wrap: pretty; }
.muted { color: var(--faint); font-size: .9375rem; }
.more { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 10px; color: var(--text); font-size: .9375rem; }
.more .i { width: 14px; height: 14px; color: var(--faint); transition: transform .3s var(--ease), color .2s; }
.more:hover .i:last-child { color: var(--accent); transform: translate(2px, -2px); }

/* top bar: wordmark, one live status pill (jumps to Now), theme */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 44px; font-size: var(--step--1); }
.mark { font-weight: 600; margin-right: auto; letter-spacing: -.02em; }
.mark span { color: var(--faint); font-weight: 500; }
.status {
  display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--soft);
  transition: border-color .2s, background-color .2s;
}
.status:hover { border-color: color-mix(in srgb, var(--soft) 35%, var(--line)); background: var(--hover); }
@media (max-width: 639px) { .status { order: 3; flex-basis: 100%; } .status-text { flex: 1 1 auto; max-width: none; } }
.status-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch; transition: opacity .25s; }
.status-text.swap { opacity: 0; }
.status-sep { color: var(--faint); }
#clock { color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; color: #1ed760; }
.eq i { width: 2px; height: 100%; border-radius: 1px; background: currentColor; transform-origin: bottom; transform: scaleY(.4); }
@media (prefers-reduced-motion: no-preference) {
  .eq i { animation: eq 1s ease-in-out infinite; }
  .eq i:nth-child(2) { animation-duration: .8s; animation-delay: -.4s; }
  .eq i:nth-child(3) { animation-duration: 1.15s; animation-delay: -.7s; }
  @keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
}
.dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--faint); transition: background-color .4s; }
.dot[data-s="online"] { background: var(--accent); }
.dot[data-s="idle"] { background: var(--warm); }
.dot[data-s="dnd"] { background: var(--red); }
.dot[data-s="spotify"] { background: #1ed760; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -4px -12px -4px 0; border-radius: 50%; color: var(--soft); transition: color .2s, background-color .2s; }
.icon-btn:hover { color: var(--text); background: var(--hover); }
.icon-btn .i { width: 16px; height: 16px; }

/* hero */
.hero { margin-top: clamp(16px, 4vw, 40px); }
.who { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.avatar { position: relative; display: grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: 50%; overflow: hidden; background: var(--hover); color: var(--faint); font-weight: 500; font-size: 1.25rem; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
h1 { font-size: var(--step-3); font-weight: 600; line-height: 1.1; letter-spacing: -.035em; }
.period { color: var(--faint); transition: color .4s; }
.period[data-s="online"] { color: var(--accent); }
.period[data-s="idle"] { color: var(--warm); }
.period[data-s="dnd"] { color: var(--red); }
.period[data-s="spotify"] { color: #1ed760; }
.handle { font-size: var(--step--1); color: var(--faint); }
.bio { max-width: 34em; font-size: var(--step-1); line-height: 1.65; color: var(--soft); text-wrap: pretty; }
.bio a, .prose a, .fine a { color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; text-decoration-color: color-mix(in srgb, var(--soft) 45%, transparent); transition: text-decoration-color .2s; }
.bio a:hover, .prose a:hover, .fine a:hover { text-decoration-color: var(--accent); }

/* now: spotify + discord, one row each */
.now { border-top: 1px solid var(--line); }
.now-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.now-art { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--surface); color: var(--faint); }
.now-art .i { width: 20px; height: 20px; }
.now-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.now-kind { font-size: .75rem; color: var(--faint); }
.now-title { font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.now-sub { color: var(--soft); font-size: .875rem; line-height: 1.45; overflow-wrap: anywhere; }
.now-sub:empty { display: none; }
.progress { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.bar-track { flex: 1; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.time { font: .8125rem var(--sans); color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
#now-music[data-on="yes"] .now-kind { color: #1ed760; }

/* anime */
.anime-stats { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 20px; color: var(--faint); font-size: var(--step--1); }
.anime-stats b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.sub-label { font-size: .75rem; color: var(--faint); margin: 0 0 10px; }
.watching { list-style: none; display: grid; gap: 2px; margin-bottom: 28px; }
.watch { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 8px; margin-inline: -8px; border-radius: 8px; transition: background-color .2s; }
.watch:hover { background: var(--hover); }
.watch img { width: 40px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--surface); }
.watch-title { font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.watch .bar-track { display: block; margin-top: 8px; max-width: 220px; }
.watch-title { display: block; }
.watch .time { align-self: center; }
.covers { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .covers { grid-template-columns: repeat(6, minmax(0, 1fr)); } } /* up to 12 covers (anilist.js): 4 and 6 columns give even rows */
.covers a { display: block; border-radius: 8px; overflow: hidden; background: var(--surface); aspect-ratio: 5 / 7; outline-offset: 2px; }
.covers img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease), opacity .3s; }
@media (hover: hover) { .covers a:hover img { transform: scale(1.04); } }

/* apps: icon, name + type, one-line purpose, action */
.rows { list-style: none; border-top: 1px solid var(--line); }
.rows li { border-bottom: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 14px 8px; margin-inline: -8px; border-radius: 6px; transition: background-color .2s; }
.row:hover { background: var(--hover); }
.tool-icon { width: 28px; height: 28px; border-radius: 7px; object-fit: cover; background: var(--hover); }
.tool-copy { min-width: 0; }
.tool-copy .t { font-weight: 500; margin-right: 8px; }
.tool-copy p { color: var(--faint); font-size: .875rem; line-height: 1.45; text-wrap: pretty; }
.tag { font-size: .75rem; color: var(--faint); white-space: nowrap; }
.get { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; margin-right: -12px; border-radius: 6px; font-size: var(--step--1); color: var(--soft); transition: color .2s, background-color .2s; }
.get:hover { color: var(--accent); background: var(--hover); }
.get .i { transition: transform .3s var(--ease); }
.get:hover .i { transform: translateY(2px); }
.note { margin-top: 12px; color: var(--soft); font-size: .875rem; }
details summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: var(--step--1); color: var(--faint); cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '+'; width: 1ch; transition: transform .3s var(--ease); }
details[open] summary::before { transform: rotate(45deg); }
details summary:hover { color: var(--text); }
details ol { padding-left: 1.25em; margin: 4px 0 12px; display: grid; gap: 4px; }
details p { color: var(--faint); }

/* wall */
.wall-form { margin: 20px 0 28px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: grid; gap: 10px; }
.field-row { display: flex; gap: 10px; align-items: center; }
.field { display: block; flex: 1; }
.field input, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  transition: border-color .2s; resize: vertical; line-height: 1.5;
}
.field textarea { min-height: 84px; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); opacity: 1; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field [aria-invalid="true"] { border-color: var(--red); }
.pfp-pick { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--soft) 40%, var(--line)); color: var(--faint); overflow: hidden; transition: color .2s, border-color .2s; }
.pfp-pick:hover { color: var(--text); border-color: var(--soft); }
.pfp-pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pfp-pick.has-img { border-style: solid; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hint { font-size: .75rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.hint.over { color: var(--red); }
.send { min-height: 40px; padding: 0 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 500; font-size: .875rem; transition: opacity .2s, transform .15s var(--ease); }
.send:hover { opacity: .88; }
.send:active { transform: scale(.97); }
.send[aria-busy="true"] { opacity: .6; cursor: progress; }
.turnstile:empty { display: none; }
.form-status { font-size: .875rem; color: var(--soft); }
.form-status:empty { display: none; }
.form-status[data-tone="bad"] { color: var(--red); }
.form-status[data-tone="good"] { color: var(--accent); }

.posts { list-style: none; display: grid; }
.post { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.post:last-child { border-bottom: 1px solid var(--line); }
.post-pfp { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: var(--surface); display: grid; place-items: center; color: var(--faint); font-weight: 500; font-size: .875rem; }
.post-pfp img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.post-name { font-weight: 500; overflow-wrap: anywhere; }
.post-name.me::after { content: 'me'; margin-left: 6px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line); font-size: .6875rem; font-weight: 400; color: var(--faint); vertical-align: 1px; }
.post time { font-size: .75rem; color: var(--faint); }
.post-msg { color: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.post.fresh { animation: fresh .6s var(--ease) both; }
@keyframes fresh { from { opacity: .001; transform: translateY(-4px); } }
.load-more { margin-top: 8px; }

/* desk */
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 10px 32px; font-size: .875rem; }
.specs dt { color: var(--faint); }
@media (min-width: 640px) { .specs { grid-template-columns: max-content 1fr max-content 1fr; } }

/* contact */
.mail { display: flex; align-items: center; gap: 4px; font-size: var(--step-1); font-weight: 500; overflow-wrap: anywhere; }
.mail a { border-bottom: 1px solid var(--line); transition: border-color .2s; }
.mail a:hover { border-color: var(--accent); }
.mail .icon-btn { margin: 0; }
.social { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 12px; font-size: .9375rem; }
.social a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--soft); transition: color .2s; }
.social a:hover { color: var(--text); }
.social .i { width: 14px; height: 14px; }
.fine { margin-top: 20px; font-size: var(--step--1); color: var(--faint); }

.music { position: fixed; right: 16px; bottom: 16px; margin: 0; border: 1px solid var(--line); background: var(--bg); }
.music[aria-pressed="true"] { color: var(--accent); }

/* one authored moment: the page settles in once, top to bottom, from visible */
@media (prefers-reduced-motion: no-preference) {
  .top, .panel > * { animation: in .7s var(--ease) both; }
  .panel > :nth-child(2) { animation-delay: .05s; }
  .panel > :nth-child(3) { animation-delay: .1s; }
  .panel > :nth-child(n+4) { animation-delay: .15s; }
  .panel.switched > * { animation: in .4s var(--ease) both; animation-delay: 0s; }
  @keyframes in { from { opacity: .001; transform: translateY(8px); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* wall as an iPhone: the live wall is an iMessage thread in the middle phone,
   the side phones are decoration (lock screen with the newest posts, a dm that is always typing) */
:root {
  --ios-bg: #000; --ios-text: #fff; --ios-meta: #8e8e93; --ios-recv: #262628; --ios-blue: #0a84ff;
  --ios-head: rgb(22 22 24 / .78); --ios-field: #1c1c1e; --ios-line: #38383a;
  --bezel: #0b0b0c; --rim: #4a4a4f;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --ios-bg: #fff; --ios-text: #000; --ios-meta: #6e6e73; --ios-recv: #e9e9eb; --ios-blue: #007aff; --ios-head: rgb(248 248 248 / .82); --ios-field: #fff; --ios-line: #d1d1d6; --rim: #a7a7ad; }
}
:root[data-theme="light"] { --ios-bg: #fff; --ios-text: #000; --ios-meta: #6e6e73; --ios-recv: #e9e9eb; --ios-blue: #007aff; --ios-head: rgb(248 248 248 / .82); --ios-field: #fff; --ios-line: #d1d1d6; --rim: #a7a7ad; }

.wall-stage { position: relative; display: flex; justify-content: center; margin: 28px 0 8px; }
.wall-stage + .turnstile { display: flex; justify-content: center; margin-top: 12px; }

.phone {
  --pw: 360px; --ph: clamp(560px, 100dvh - 240px, 740px);
  position: relative; flex: none; width: min(var(--pw), 100%); height: var(--ph);
  padding: 11px; border-radius: 60px; background: var(--bezel);
  box-shadow: 0 0 0 1.5px var(--rim), 0 0 0 4px #161618, inset 0 0 0 1.5px #222, 0 50px 90px -40px rgb(0 0 0 / .7);
}
/* side buttons: action + volume on the left, power on the right */
.phone::before, .phone::after { content: ''; position: absolute; width: 4px; border-radius: 2px; background: var(--rim); }
.phone::before { left: -6px; top: 120px; height: 168px;
  background: linear-gradient(var(--rim) 0 30px, transparent 30px 52px, var(--rim) 52px 106px, transparent 106px 114px, var(--rim) 114px 168px); }
.phone::after { right: -6px; top: 178px; height: 86px; }

.screen {
  position: relative; height: 100%; border-radius: 49px; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; background: var(--ios-bg); color: var(--ios-text);
  font-family: -apple-system, 'SF Pro Text', var(--sans); letter-spacing: -.01em;
}
.island { position: absolute; z-index: 5; top: 11px; left: 50%; width: 118px; height: 34px; margin-left: -59px; border-radius: 20px; background: #000; }
.ios-bar { flex: none; display: flex; justify-content: space-between; align-items: center; height: 54px; padding: 4px 30px 0 40px; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; position: relative; z-index: 4; }
.ios-icons { display: flex; align-items: center; gap: 6px; }
.ios-icons svg { height: 12px; width: auto; fill: currentColor; }
.home-bar { position: absolute; z-index: 6; bottom: 8px; left: 50%; width: 134px; height: 5px; margin-left: -67px; border-radius: 3px; background: var(--ios-text); opacity: .9; pointer-events: none; }

/* chat header: frosted, back chevron + count, little faces, the name */
.chat-head { position: relative; z-index: 3; flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 58px 16px 10px; margin-top: -54px;
  background: var(--ios-head); backdrop-filter: blur(20px) saturate(1.6); border-bottom: .5px solid var(--ios-line); }
.chat-back { display: inline-flex; align-items: center; gap: 4px; color: var(--ios-blue); font-size: 15px; }
.chat-back svg { width: 11px; height: 19px; }
#chat-count { min-width: 22px; padding: 1px 6px; border-radius: 999px; background: var(--ios-blue); color: #fff; font-size: 13px; font-weight: 600; text-align: center; }
#chat-count:empty { display: none; }
.chat-who { display: grid; justify-items: center; gap: 3px; }
.faces { display: flex; height: 42px; align-items: center; }
.face { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; background: linear-gradient(#a3a3a8, #85858b); color: #fff; font-size: 17px; font-weight: 600; box-shadow: 0 0 0 2px var(--ios-bg); }
.faces .face + .face { margin-left: -6px; }
.faces .face:not(:only-child) { width: 30px; height: 30px; font-size: 13px; }
.face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-name { font-size: 11px; display: flex; align-items: center; gap: 3px; }
.chat-name span { color: var(--ios-meta); font-size: 12px; }
.chat-cam { justify-self: end; color: var(--ios-blue); }
.chat-cam svg { width: 26px; height: 16px; display: block; }

.thread { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px 12px; scrollbar-width: none; }
.thread::-webkit-scrollbar { display: none; }
.thread:focus-visible { outline: 2px solid var(--ios-blue); outline-offset: -4px; border-radius: 0; }
.earlier { display: block; margin: 2px auto 10px; min-height: 32px; padding: 0 12px; color: var(--ios-blue); font-size: 13px; }

/* bubbles */
.bubbles { list-style: none; display: flex; flex-direction: column; font-size: 16px; line-height: 1.3; }
.bubbles .stamp { align-self: center; margin: 14px 0 8px; font-size: 11px; color: var(--ios-meta); font-weight: 500; }
.bubbles .stamp:first-child { margin-top: 0; }
.bubbles .who { margin: 8px 0 2px 50px; font-size: 11px; color: var(--ios-meta); overflow-wrap: anywhere; }
.bubbles .who.me-name { color: var(--ios-blue); }
.bubbles .seen { align-self: flex-end; margin: 3px 4px 0 0; font-size: 11px; color: var(--ios-meta); font-weight: 500; }
.b { position: relative; display: flex; max-width: 80%; margin-top: 2px; }
.b.first { margin-top: 6px; }
.b.in { align-self: flex-start; padding-left: 38px; }
.b.out { align-self: flex-end; }
.b p { position: relative; isolation: isolate; padding: 7px 12px; border-radius: 18px; background: var(--ios-recv); white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.b.out p { background: var(--ios-blue); color: #fff; }
.b.in:not(.first) p { border-top-left-radius: 6px; }
.b.in:not(.last) p { border-bottom-left-radius: 6px; }
.b.out:not(.first) p { border-top-right-radius: 6px; }
.b.out:not(.last) p { border-bottom-right-radius: 6px; }
/* tails, only on the last bubble of a run */
.b.last p::before, .b.last p::after { content: ''; position: absolute; z-index: -1; bottom: 0; height: 22px; }
.b.in.last p::before { left: -7px; width: 20px; background: var(--ios-recv); border-bottom-right-radius: 16px 14px; }
.b.in.last p::after { left: -26px; width: 26px; background: var(--ios-bg); border-bottom-right-radius: 10px; }
.b.out.last p::before { right: -7px; width: 20px; background: var(--ios-blue); border-bottom-left-radius: 16px 14px; }
.b.out.last p::after { right: -26px; width: 26px; background: var(--ios-bg); border-bottom-left-radius: 10px; }
.b .av { position: absolute; z-index: 1; left: 0; bottom: 0; width: 30px; height: 30px; font-size: 13px; box-shadow: none; }
.b.in:not(.last) .av { visibility: hidden; }
.b.emoji p { background: none; padding: 0 2px; font-size: 40px; line-height: 1.1; }
.b.emoji p::before, .b.emoji p::after { display: none; }
.b.fresh { animation: pop .5s var(--ease) both; transform-origin: bottom right; }
.b.in.fresh { transform-origin: bottom left; }
@keyframes pop { from { opacity: .001; transform: translateY(14px) scale(.86); } }
.bubbles .muted { align-self: center; margin-top: 40%; color: var(--ios-meta); font-size: 13px; text-align: center; }

.typing p { display: flex; gap: 4px; padding: 12px 14px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--ios-meta); opacity: .5; }
@media (prefers-reduced-motion: no-preference) {
  .typing i { animation: dots 1.3s infinite; }
  .typing i:nth-child(2) { animation-delay: .18s; }
  .typing i:nth-child(3) { animation-delay: .36s; }
  @keyframes dots { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: .9; transform: translateY(-2px); } }
}

/* composer: from row, then the pill with the blue send arrow */
.wall-stage .composer { flex: none; margin: 0; padding: 8px 12px 26px; border: 0; border-top: .5px solid var(--ios-line); border-radius: 0; background: var(--ios-head); backdrop-filter: blur(20px); display: grid; gap: 8px; }
.from-row { display: flex; align-items: center; gap: 8px; }
.wall-stage .pfp-pick { width: 30px; height: 30px; border: 0; background: var(--ios-recv); color: var(--ios-meta); }
.wall-stage .pfp-pick .i { width: 15px; height: 15px; }
.from { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ios-meta); }
.from input { flex: 1; min-width: 0; height: 30px; border: 0; background: none; color: var(--ios-text); font-size: 15px; padding: 0; }
.from input::placeholder, .msg-pill textarea::placeholder { color: var(--ios-meta); opacity: 1; }
.from input:focus, .msg-pill textarea:focus { outline: none; }
.from:focus-within { color: var(--ios-blue); }
.from input[aria-invalid="true"]::placeholder { color: var(--red); }
.wall-stage .hint { font-size: 11px; color: var(--ios-meta); opacity: 0; transition: opacity .2s; }
.composer:focus-within .hint, .wall-stage .hint.over { opacity: 1; }
.wall-stage .hint.over { color: var(--red); }
.msg-row { display: flex; align-items: flex-end; gap: 8px; }
.msg-pill { flex: 1; min-width: 0; display: flex; min-height: 36px; padding: 7px 14px; border: 1px solid var(--ios-line); border-radius: 18px; background: var(--ios-field); transition: border-color .2s; }
.msg-pill:focus-within { border-color: var(--ios-meta); }
.msg-pill:has([aria-invalid="true"]) { border-color: var(--red); }
.msg-pill textarea { flex: 1; resize: none; border: 0; padding: 0; background: none; color: var(--ios-text); font-size: 16px; line-height: 20px; height: 20px; max-height: 100px; overflow-y: auto; scrollbar-width: none; }
.wall-stage .send { display: grid; place-items: center; flex: none; width: 32px; height: 32px; min-height: 0; padding: 0; margin-bottom: 2px; border-radius: 50%; background: var(--ios-blue); color: #fff; opacity: .35; transition: opacity .2s, transform .15s var(--ease); }
.wall-stage .send svg { width: 16px; height: 16px; }
.wall-stage .send.ready { opacity: 1; }
.wall-stage .send:active { transform: scale(.9); }
.wall-stage .form-status { font-size: 12px; text-align: center; color: var(--ios-meta); margin-top: -2px; }
.wall-stage .form-status[data-tone="bad"] { color: var(--red); }
.wall-stage .form-status[data-tone="good"] { color: var(--ios-meta); }

@media (max-width: 400px) {
  .phone { padding: 8px; border-radius: 52px; }
  .screen { border-radius: 44px; }
  .ios-bar { padding-inline: 32px 24px; }
}
@media (prefers-reduced-motion: reduce) { .b.fresh { animation: none; } }

/* ---- wall fx (fx.js): only while the wall tab is open ---- */
/* --amb is the colour of the latest message's mood; registered so it fades instead of snapping */
@property --amb { syntax: '<color>'; inherits: true; initial-value: #88d4a8; }
:root { --amb: var(--accent); transition: --amb 1.2s ease-out; }

.amb { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .8s ease-out; }
.on-wall .amb { opacity: 1; }
.amb i { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease-out; }
.amb i.on { opacity: 1; }
.amb b { position: absolute; left: 0; top: 0; width: 600px; height: 600px; border-radius: 50%; opacity: 0; transition: opacity .8s;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--amb) 10%, transparent), transparent); will-change: transform; }
.amb b.on { opacity: 1; }
/* film grain over the glow, under everything you read */
.amb::after { content: ''; position: absolute; inset: -50%; opacity: .05; mix-blend-mode: overlay;
  background: 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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
:root[data-theme="light"] .amb::after { opacity: .08; mix-blend-mode: multiply; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .amb::after { opacity: .08; mix-blend-mode: multiply; } }
@media (prefers-reduced-motion: no-preference) {
  .on-wall .amb::after { animation: grain 1s steps(6) infinite; }
  @keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); } }
  /* sending: the glow swells, then settles */
  .amb.pulse i.on { animation: swell 1.4s var(--ease); }
  @keyframes swell { 0% { transform: scale(1); filter: brightness(1); } 25% { transform: scale(1.06); filter: brightness(1.9); } 100% { transform: scale(1); filter: brightness(1); } }
  /* and the phone screen catches a flash of the colour */
  .screen.flash::before { content: ''; position: absolute; inset: 0; z-index: 8; pointer-events: none; border-radius: inherit;
    box-shadow: inset 0 0 60px color-mix(in srgb, var(--amb) 70%, transparent); animation: flash 1s ease-out both; }
  @keyframes flash { from { opacity: 1; } to { opacity: 0; } }
}
.phone-main { box-shadow: 0 0 0 1.5px var(--rim), 0 0 0 4px #161618, inset 0 0 0 1.5px #222, 0 50px 90px -40px rgb(0 0 0 / .7), 0 0 140px -30px color-mix(in srgb, var(--amb) 45%, transparent); }

/* screen effects + tapbacks */
.fx-layer { position: absolute; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; }
.fx-bit { position: absolute; left: 0; top: 0; width: 7px; height: 11px; border-radius: 2px; }
.fx-emoji { position: absolute; left: 0; top: 0; line-height: 1; }
.b[data-id] { touch-action: manipulation; }
.tap { position: absolute; top: -14px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ios-recv); box-shadow: 0 0 0 2px var(--ios-bg); z-index: 1; }
.b.in .tap { right: -12px; background: var(--ios-blue); }
.b.out .tap { left: -12px; }
.tap svg { width: 13px; height: 13px; fill: #ff375f; }
.b.in .tap svg { fill: #fff; }
.b:has(.tap) { margin-top: 16px; }
.tap.pop { animation: tap .45s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes tap { from { transform: scale(.2); opacity: 0; } }

/* ---- site background: black, a dot grid that fades out down the page, a soft light from the top,
   and the dots under the pointer light up. Background only, nothing here takes clicks. ---- */
:root { --dot: rgb(255 255 255 / .085); --dot-lit: rgb(255 255 255 / .32); --top-light: rgb(255 255 255 / .045); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --dot: rgb(0 0 0 / .09); --dot-lit: rgb(0 0 0 / .3); --top-light: rgb(255 255 255 / .7); } }
:root[data-theme="light"] { --dot: rgb(0 0 0 / .09); --dot-lit: rgb(0 0 0 / .3); --top-light: rgb(255 255 255 / .7); }

.bg { position: fixed; inset: 0; z-index: -3; pointer-events: none; overflow: hidden;
  background: radial-gradient(ellipse 70% 45% at 50% -8%, var(--top-light), transparent 70%); }
.bg::before, .bg::after { content: ''; position: absolute; inset: 0; }
.bg::before {
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 1.5px);
  background-size: 24px 24px; background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 25%, transparent 85%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 25%, transparent 85%);
}
.bg::after { display: none; }
/* the lit spot under the pointer, cut to the dot grid and faded at the edge.
   The colour is a field pinned to the screen (violet left, teal top right, pink low middle, same places as
   the aurora), so the spot shows the colour of wherever it is instead of dragging one gradient around.
   Moving fast opens the spot up and brightens it (--v 0..1 and --sr come from fx.js); a soft halo of the
   same colour sits under the dots, and a click sends a ring out through the grid. */
@property --r { syntax: '<length>'; inherits: false; initial-value: 0px; }
:root { --halo: .07; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --halo: .09; } }
:root[data-theme="light"] { --halo: .09; }
.bg .cur { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease-out; }
.bg.lit .cur { opacity: 1; }
/* not on the wall: its own mood glow is the background there */
.on-wall .bg .cur, .on-wall .bg .ripple { display: none; }
.bg .spot, .bg .halo, .bg .ripple { position: absolute; left: 0; top: 0; width: 440px; height: 440px; will-change: transform;
  background:
    radial-gradient(30% 42% at 55% 66%, var(--sub-c), transparent 72%),
    radial-gradient(36% 48% at 82% 18%, var(--sub-b), transparent 72%),
    linear-gradient(115deg, var(--sub-a) 15%, color-mix(in srgb, var(--sub-a), var(--sub-b)) 55%, var(--sub-b) 90%);
  background-size: var(--W, 100vw) var(--H, 100vh); background-position: var(--fx, 0) var(--fy, 0); background-repeat: no-repeat; }
.bg .spot {
  -webkit-mask-image: radial-gradient(circle at 1px 1px, #000 1px, transparent 1.5px), radial-gradient(circle var(--sr, 150px), #000, rgb(0 0 0 / .55) 40%, rgb(0 0 0 / .18) 72%, transparent);
  mask-image: radial-gradient(circle at 1px 1px, #000 1px, transparent 1.5px), radial-gradient(circle var(--sr, 150px), #000, rgb(0 0 0 / .55) 40%, rgb(0 0 0 / .18) 72%, transparent);
  -webkit-mask-size: 24px 24px, 100% 100%; mask-size: 24px 24px, 100% 100%;
  -webkit-mask-position: var(--dx, 0) var(--dy, 0), 0 0; mask-position: var(--dx, 0) var(--dy, 0), 0 0;
  -webkit-mask-repeat: repeat, no-repeat; mask-repeat: repeat, no-repeat;
  -webkit-mask-composite: source-in; mask-composite: intersect;
  opacity: calc(.62 + var(--v, 0) * .33); }
.bg .halo {
  -webkit-mask-image: radial-gradient(circle var(--sr, 150px), #000, rgb(0 0 0 / .35) 45%, transparent);
  mask-image: radial-gradient(circle var(--sr, 150px), #000, rgb(0 0 0 / .35) 45%, transparent);
  opacity: calc(var(--halo) * (1 + var(--v, 0))); }
.bg .ripple { width: 640px; height: 640px; opacity: 0;
  -webkit-mask-image: radial-gradient(circle at 1px 1px, #000 1.2px, transparent 1.7px), radial-gradient(circle, transparent calc(var(--r) - 34px), #000 calc(var(--r) - 6px), transparent var(--r));
  mask-image: radial-gradient(circle at 1px 1px, #000 1.2px, transparent 1.7px), radial-gradient(circle, transparent calc(var(--r) - 34px), #000 calc(var(--r) - 6px), transparent var(--r));
  -webkit-mask-size: 24px 24px, 100% 100%; mask-size: 24px 24px, 100% 100%;
  -webkit-mask-position: var(--dx, 0) var(--dy, 0), 0 0; mask-position: var(--dx, 0) var(--dy, 0), 0 0;
  -webkit-mask-repeat: repeat, no-repeat; mask-repeat: repeat, no-repeat;
  -webkit-mask-composite: source-in; mask-composite: intersect; }
/* on the wall the mood glow takes over and the grid steps back */
.on-wall .bg::before { opacity: .5; transition: opacity .8s; }

/* ---- wall polish ---- */
/* titanium rim: a lit edge top-left, darker bottom-right */
.phone { background: linear-gradient(150deg, #3a3a3f 0%, #0b0b0c 6%, #0b0b0c 94%, #2a2a2e 100%);
  box-shadow: 0 0 0 1px #5a5a60, 0 0 0 3.5px #18181a, 0 0 0 4.5px #3a3a3f, inset 0 0 0 1.5px #000, 0 60px 100px -45px rgb(0 0 0 / .8); }
.phone-main { box-shadow: 0 0 0 1px #5a5a60, 0 0 0 3.5px #18181a, 0 0 0 4.5px #3a3a3f, inset 0 0 0 1.5px #000, 0 60px 100px -45px rgb(0 0 0 / .8), 0 0 140px -30px color-mix(in srgb, var(--amb) 45%, transparent); }
/* glass: one faint diagonal reflection over the screen */
.glare { position: absolute; inset: 0; z-index: 9; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, rgb(255 255 255 / .06) 0%, rgb(255 255 255 / .015) 28%, transparent 42%); }
:root[data-theme="light"] .glare { opacity: .4; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .glare { opacity: .4; } }

/* sent bubbles stay solid iOS blue: a gradient never lines up with the tail */
.b.emoji p, .b.out.emoji p { background: none; }

/* stamps like iOS: bold day, light time */
.bubbles .stamp { font-weight: 400; }
.bubbles .stamp b { font-weight: 600; }

/* thread fades under the header and composer instead of cutting off */
.thread { -webkit-mask-image: linear-gradient(transparent, #000 14px, #000 calc(100% - 10px), transparent); mask-image: linear-gradient(transparent, #000 14px, #000 calc(100% - 10px), transparent); }

/* the first time the thread shows, bubbles rise in one after another */
@media (prefers-reduced-motion: no-preference) {
  .bubbles.intro > li { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
  @keyframes rise { from { opacity: .001; transform: translateY(16px) scale(.97); } }
}

/* empty wall: a contact card with one-tap openers */
.empty-card { margin: auto 0; padding: 40px 8px 20px; display: grid; justify-items: center; text-align: center; gap: 4px; }
.bubbles:has(.empty-card) { min-height: 100%; }
.face.big { width: 76px; height: 76px; font-size: 30px; margin-bottom: 8px; box-shadow: 0 0 0 1px var(--ios-line), 0 10px 30px -10px color-mix(in srgb, var(--amb) 60%, transparent); }
.empty-name { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.empty-sub { font-size: 13px; color: var(--ios-meta); }
.openers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.opener { padding: 7px 13px; border-radius: 18px; background: var(--ios-recv); color: var(--ios-text); font-size: 14px; transition: transform .15s var(--ease), background-color .2s; }
.opener:hover { background: color-mix(in srgb, var(--ios-blue) 22%, var(--ios-recv)); }
.opener:active { transform: scale(.95); }
@media (prefers-reduced-motion: no-preference) {
  .empty-card > * { animation: rise .6s var(--ease) both; }
  .empty-card > :nth-child(2) { animation-delay: .06s; }
  .empty-card > :nth-child(3) { animation-delay: .12s; }
  .empty-card > :nth-child(4) { animation-delay: .2s; }
}

/* under the phone: the house rules, quietly */
.wall-rules { margin-top: 18px; text-align: center; font-size: var(--step--1); color: var(--faint); }

/* ---- subliminal colour: barely there, the page still reads black ---- */
:root { --sub-a: #a78bfa; --sub-b: #5eead4; --sub-c: #f9a8d4; --aur: .09; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --sub-a: #7c3aed; --sub-b: #0d9488; --sub-c: #db2777; --aur: .06; } }
:root[data-theme="light"] { --sub-a: #7c3aed; --sub-b: #0d9488; --sub-c: #db2777; --aur: .06; }
.bg .aurora { position: absolute; left: -15%; right: -15%; top: -25%; height: 75%; filter: blur(30px); transition: opacity .8s;
  background:
    radial-gradient(38% 50% at 22% 35%, color-mix(in srgb, var(--sub-a) calc(var(--aur) * 100%), transparent), transparent 70%),
    radial-gradient(34% 45% at 80% 22%, color-mix(in srgb, var(--sub-b) calc(var(--aur) * 80%), transparent), transparent 70%),
    radial-gradient(28% 40% at 55% 62%, color-mix(in srgb, var(--sub-c) calc(var(--aur) * 50%), transparent), transparent 70%); }
.bg .hairline { position: absolute; left: 0; right: 0; top: 0; height: 1px; opacity: .45;
  background: linear-gradient(90deg, transparent, var(--sub-a) 30%, var(--sub-b) 55%, var(--sub-c) 75%, transparent); }
.on-wall .bg .aurora { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .bg .aurora { animation: aurora 48s ease-in-out infinite alternate; }
  @keyframes aurora { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(5%, 4%, 0) scale(1.1) rotate(2deg); } 100% { transform: translate3d(-4%, 2%, 0) scale(1.04) rotate(-2deg); } }
  .bg .hairline { background-size: 200% 100%; animation: hair 14s linear infinite; }
  @keyframes hair { from { background-position: 0 0; } to { background-position: -200% 0; } }
}
