/* MOODY on the web: the profile tab of the app, at moody.li/<handle>.
   Same sizes as the app: text 34 / 21 / 15, outlines 3, side margin 20, rounded 28. */

@font-face { font-family: "Moody"; src: url("/fonts/moody.woff") format("woff"); font-weight: 700; font-display: swap; }

:root {
  --ink: #000; --paper: #fff; --red: #ff3b30;
  --stroke: 3px; --gutter: 20px; --radius: 28px;
  /* page spacing grows with the window: sides follow its width, top and bottom its height */
  --padx: max(20px, 6vw); --pady: max(16px, 5vh);
  --colw: 1040px;   /* widest the profile gets on big screens */
  --title: 34px; --body: 21px; --small: 15px;
  --ui: "Moody", "Arial Narrow", sans-serif;
  --pw: "Barlow Condensed", "Arial Narrow", sans-serif;   /* the same letters, with lowercase: for passwords */
}
@media (prefers-color-scheme: dark) { :root { --ink: #fff; --paper: #000; --red: #ff453a; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 700 var(--body)/1.25 var(--ui); text-transform: uppercase; -webkit-font-smoothing: antialiased; }
#app { display: flow-root; min-height: 100vh; min-height: 100svh; background: var(--paper); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; text-transform: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
input, textarea { font: inherit; text-transform: inherit; color: inherit; }
svg.i { width: 1em; height: 1em; display: block; flex: none; }
.hidden { display: none !important; }
.small { font-size: var(--small); }
.title { font-size: var(--title); line-height: 1.05; }
.red { color: var(--red); }

/* ── layout ── */
.col { width: 100%; max-width: calc(var(--colw) + 2 * var(--padx)); margin: 0 auto; padding: 0 var(--padx); }
.bar { height: 52px; margin-top: var(--pady); display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; }
.bar .mid { justify-self: center; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--title); white-space: nowrap; overflow: hidden; }
.bar .mid span { overflow: hidden; text-overflow: ellipsis; }
.bar .left { justify-self: start; } .bar .right { justify-self: end; }

/* ── home ── */
.home { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: max(32px, 5vh); padding: var(--pady) var(--padx) calc(var(--pady) + 64px); position: relative; text-align: center; }
.brand { display: flex; align-items: center; gap: .22em; font-size: clamp(40px, 3.7vw, 110px); line-height: 1; margin: 0; }
@media (max-width: 700px) { .brand { font-size: clamp(40px, 9vw, 64px); } }
.brand .logo { width: 1.26em; height: 1.26em; }
.home .ctas { display: flex; flex-direction: column; gap: 12px; width: clamp(260px, 24vw, 460px); max-width: 100%; }
.home .footer { position: absolute; left: 0; right: 0; bottom: calc(var(--pady) + env(safe-area-inset-bottom)); }
.links { display: flex; gap: 20px; justify-content: center; font-size: var(--small); }
.links a:hover { text-decoration: underline; }

/* ── buttons ── */
.pill { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; padding: 0 16px;
  border: var(--stroke) solid var(--ink); border-radius: 999px; font-size: var(--body); white-space: nowrap; transition: transform .14s; }
.pill.big { height: 56px; }
.pill.filled { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill:active:not(:disabled) { transform: scale(.97); }
.pill:disabled { border-style: dashed; opacity: 1; }
.pill.filled:disabled { background: transparent; color: var(--ink); }
.pill.filled:disabled span { color: var(--ink); }
.round { width: 48px; height: 48px; border: var(--stroke) solid currentColor; border-radius: 50%; display: grid; place-items: center; font-size: var(--body); }
.round:active { transform: scale(.95); }
.row { display: flex; gap: 8px; }
.row > * { flex: 1 1 0; min-width: 0; }
.row > .w56 { flex: 0 0 56px; }
.compose-wide { display: none !important; }
.tile-btn { height: 72px; border: var(--stroke) solid var(--ink); border-radius: var(--radius); display: grid; place-items: center; font-size: var(--body); width: 100%; }
.tile-btn:active { transform: scale(.97); }

/* ── fields ── */
.field { display: flex; align-items: center; gap: 2px; height: 64px; padding: 0 24px; border: var(--stroke) solid currentColor; border-radius: 999px; }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; padding: 0; font-size: var(--body); }
.field input::placeholder, textarea::placeholder { color: currentColor; opacity: .3; }
.field input.pw { font-family: var(--pw); text-transform: none; letter-spacing: .01em; }
.field input.pw:placeholder-shown { font-family: var(--ui); text-transform: uppercase; }
.field .eye { width: 36px; height: 36px; display: grid; place-items: center; font-size: 17px; margin-right: -8px; }
.area { border: var(--stroke) solid currentColor; border-radius: var(--radius); padding: 20px; }
.area textarea { width: 100%; border: 0; outline: 0; background: transparent; resize: none; font-size: var(--body); line-height: 1.25; display: block; }
.codes { position: relative; display: flex; gap: 8px; height: 64px; }
.codes span { flex: 1; border: var(--stroke) solid currentColor; border-radius: 22px; display: grid; place-items: center; font-size: var(--title); }
.codes input { position: absolute; inset: 0; opacity: 0; font-size: 16px; }
.label { font-size: var(--small); padding-left: 12px; }
.hint { font-size: var(--small); padding: 0 8px; }
.section { display: flex; flex-direction: column; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack24 { display: flex; flex-direction: column; gap: 24px; }

/* ── avatar ── */
.av { position: relative; flex: none; border-radius: 50%; border: var(--stroke) solid var(--ink); overflow: hidden; display: grid; place-items: center; background: var(--paper); color: var(--ink); }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av.anon { border-style: dashed; background: transparent; }

/* ── profile ── */
.head { display: flex; flex-direction: column; gap: 12px; padding-top: max(14px, 3vh); }
.head .top { display: flex; align-items: center; gap: 16px; }
.head .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.head .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); }
.stats button { text-align: left; line-height: 1.15; }
.bio { white-space: pre-wrap; overflow-wrap: anywhere; }
.bio a { text-decoration: none; }
.bio a:hover { text-decoration: underline; }
.igrow { display: flex; align-items: center; gap: 10px; }
.emoji { font-family: system-ui, "Apple Color Emoji", "Segoe UI Emoji", sans-serif; text-transform: none; }
.actions { padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.posts { display: flex; flex-direction: column; gap: 24px; padding: 24px 0 var(--pady); }
.post { cursor: pointer; display: flex; flex-direction: column; gap: 8px; position: relative; user-select: none; }
.post .body { overflow-wrap: anywhere; }
.counts { display: flex; align-items: center; font-size: var(--small); }
.counts .g { display: flex; align-items: center; gap: 16px; }
.counts .c { display: flex; align-items: center; gap: 4px; }
.counts .moods { display: flex; gap: 10px; margin-left: 28px; }
.counts .sp { flex: 1; }
.counts svg.i { font-size: 15px; }
.mtline { display: flex; align-items: center; gap: 6px; font-size: var(--small); }
.byline { display: flex; align-items: center; gap: 8px; font-size: var(--small); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 60px 0; }
.empty svg.i { font-size: 34px; }
.lock { font-size: .6em; }
svg.i.thick * { stroke-width: 3.6px; }
.empty svg.i.thick * { stroke-width: 2.4px; }   /* the big lock keeps a lighter line, like the app's */

/* ── sheets ── */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { width: 100%; max-width: 560px; max-height: calc(100% - 40px); background: var(--paper); color: var(--ink); border-radius: 44px 44px 0 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--gutter) calc(24px + env(safe-area-inset-bottom)); animation: up .26s cubic-bezier(.2,.9,.3,1); }
@media (min-width: 700px) { .scrim { align-items: center; padding: var(--pady) var(--padx); } .sheet { border-radius: 44px; max-width: min(720px, 100%); max-height: 100%; padding: 0 max(var(--gutter), 3vw) 32px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet .shead { display: flex; align-items: center; justify-content: space-between; padding: 24px 0 18px; gap: 12px; }
.sheet .shead .title { min-width: 0; }

/* ── post sheet ── */
.card { aspect-ratio: 1; max-height: 360px; width: 100%; border: var(--stroke) solid currentColor; border-radius: 36px; display: grid; place-items: center; padding: var(--gutter); text-align: center; position: relative; overflow: hidden; }
.card .t { font-size: clamp(22px, 7vw, var(--title)); line-height: 1.1; overflow-wrap: anywhere; }
.card textarea { width: 100%; height: 100%; text-align: center; border: 0; outline: 0; background: transparent; resize: none; font-size: var(--title); line-height: 1.1; padding-top: 30%; }
.reactrow { display: flex; gap: 14px; font-size: var(--small); flex-wrap: wrap; }
.comments { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.cm { display: flex; gap: 12px; align-items: flex-start; }
.cm.reply { padding-left: 52px; }
.cm .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cm .txt .b { overflow-wrap: anywhere; }
.cm .acts { display: flex; align-items: center; gap: 16px; font-size: var(--small); padding-top: 2px; }
.cm .acts button { display: flex; align-items: center; gap: 4px; }
.cm .more { font-size: var(--small); padding: 4px; }
.composer { position: sticky; bottom: 0; background: var(--paper); padding: 12px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.composer .field { height: 56px; padding: 0 8px 0 22px; }
.composer .send { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: 17px; flex: none; }
.composer .send:disabled { opacity: .3; }

/* ── lists, insights ── */
.person { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: var(--stroke) solid currentColor; border-radius: 999px; }
.person .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { aspect-ratio: 1; border: var(--stroke) solid currentColor; border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; }
.tile svg.i { font-size: 21px; }
.tile .sp { flex: 1; }
.hist { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border: var(--stroke) solid currentColor; border-radius: 999px; font-size: var(--small); }
.hist s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank { height: 56px; border-radius: 999px; background: var(--red); color: #fff; display: grid; place-items: center; width: 100%; }
.grid8 { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.grid8 button { font-size: 30px; height: 44px; }
.saved { border: var(--stroke) solid currentColor; border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.menu { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }

/* ── heart pop, confetti, toast ── */
.burst { position: absolute; left: 50%; top: 50%; width: 80px; height: 80px; margin: -40px 0 0 -40px; color: var(--red); pointer-events: none; z-index: 2; }
.burst svg { width: 100%; height: 100%; }
.burst.like { animation: jiggle .75s ease-out forwards; }
.burst.unlike { animation: fall .65s ease-in forwards; }
@keyframes jiggle {
  0% { transform: scale(.6); opacity: 0; } 12% { transform: scale(1); opacity: 1; }
  24% { transform: scale(1.14, .88) rotate(-7deg); } 36% { transform: scale(.92, 1.09) rotate(6deg); }
  48% { transform: scale(1.05, .96) rotate(-3deg); } 60% { transform: scale(1); } 76% { opacity: 1; } 100% { opacity: 0; }
}
@keyframes fall {
  0% { opacity: 1; transform: none; } 18% { transform: translateY(-8%); }
  60% { opacity: 1; } 100% { opacity: 0; transform: translateY(130%) rotate(25deg); }
}
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; }
.toast { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper);
  padding: 12px 22px; border-radius: 999px; font-size: var(--small); z-index: 90; max-width: calc(100% - 40px); text-align: center; animation: fade .2s; }
.spin { width: 22px; height: 22px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; }
.center { display: grid; place-items: center; padding: 120px 0; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ── bigger screens: the same layout as on a tablet, never wider than 760 px, centered.
   Header, profile, buttons and posts all share one width, so the space left and right is always equal. ── */
:root { --padx: max(20px, 6vw); }
.col, .col.profile, .col.bar { max-width: calc(760px + 2 * var(--padx)); }
@media (min-width: 600px) {
  .compose-wide { display: flex !important; }
  .compose-narrow { display: none !important; }
  /* more air on computers: picture ↔ name and counts, then bio, instagram, buttons and the first post */
  .head { gap: 22px; padding-top: max(24px, 4vh); }
  .head .top { gap: 36px; }
  .head .who { gap: 12px; }
  .actions { padding-top: 32px; }
  .posts { padding-top: 44px; }
}
