/* Character profile pages (/gly, /dozer, /turbo): a pretend Instagram in GLYSPACE colours and type. */
@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-var.woff2") format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans-var.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }
:root {
  --ink: #0d1a3f; --paper: #fff; --mist: #eef1f8; --line: #e1e5ef; --muted: #59638a; --orange: #ff8a1f; --accent: #ff8a1f;
  --display: "Bricolage", "Arial Black", system-ui, sans-serif; --text: "DM Sans", system-ui, sans-serif;
  --ring: conic-gradient(from 200deg, #ff8a1f, #ff6b5e, #7b5cff, #2bb6a8, #ffd23f, #ff8a1f);
}
body { background: var(--paper); color: var(--ink); font-family: var(--text); font-size: 16px; }

/* top bar */
.fbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; padding: 0 16px;
  background: rgb(255 255 255 / .9); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.fbar__back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-family: var(--display); font-weight: 800; font-stretch: 90%; font-size: 1.15rem; letter-spacing: -.03em; }
.fbar__back svg { width: 20px; height: 20px; }
.fbar__back img { width: 38px; }
@media (max-width: 420px) { .fbar__back span { display: none; } }
.fbar__shop { padding: 9px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: .9rem; }
.feed { max-width: 940px; margin: 0 auto; padding: 28px 16px 40px; }

/* avatars: the crew plush on its card colour, cropped to the face */
.ava { --s: 32px; flex: none; display: inline-block; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden; background: var(--f, var(--mist)); vertical-align: middle; }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.ava--sm { --s: 32px; } .ava--md { --s: 52px; } .ava--xl { --s: clamp(86px, 20vw, 150px); }
.ava--you { display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 800; font-size: .62rem; letter-spacing: .02em; }
.ava--md.ava--you { font-size: .85rem; }
.ava--tray { --s: 58px; }

/* profile header */
.prof { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(18px, 6vw, 80px); align-items: center; padding: 0 clamp(0px, 4vw, 40px) 26px; }
.prof__ring { padding: 4px; border-radius: 50%; background: var(--ring); }
.prof__ring .ava { box-shadow: 0 0 0 4px #fff; }
.prof__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.prof__handle { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 800; font-stretch: 90%; font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -.02em; line-height: 1.1; }
.tick { width: 22px; height: 22px; }
.prof__btns { display: flex; gap: 8px; }
.pbtn { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 18px; border-radius: 10px; background: var(--mist); font-weight: 700; font-size: .92rem; white-space: nowrap; }
.pbtn--solid { background: var(--ink); color: #fff; }
.prof__stats { display: flex; gap: clamp(16px, 4vw, 40px); margin: 16px 0 14px; font-size: 1rem; }
.prof__stats b { font-weight: 800; }
.prof__bio { line-height: 1.45; }
.prof__name { font-weight: 800; }
.prof__name span { font-weight: 500; color: var(--muted); }
@media (max-width: 600px) {
  .prof { grid-template-columns: auto minmax(0, 1fr); gap: 18px; padding-inline: 0; }
  .prof__stats { margin: 10px 0 0; font-size: .92rem; gap: 14px; }
  .prof__bio { grid-column: 1 / -1; }
  .prof__main { display: contents; }
  .prof__row { grid-column: 2; }
  .prof__stats { grid-column: 2; grid-row: 2; }
  .prof__ring { grid-row: 1 / span 2; }
}

/* highlights */
.hl { display: flex; gap: clamp(14px, 4vw, 40px); overflow-x: auto; padding: 4px clamp(0px, 4vw, 40px) 22px; scrollbar-width: none; }
.hl::-webkit-scrollbar { display: none; }
.hl button { display: grid; justify-items: center; gap: 8px; width: 84px; }
.hl__ring { display: block; width: 76px; height: 76px; padding: 3px; border-radius: 50%; background: var(--line); }
.hl__ring img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; border-radius: 50%; border: 3px solid #fff; }
.hl__name { font-size: .82rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl button:hover .hl__ring { background: var(--ring); }

/* art-style tabs */
.tabs { border-top: 1px solid var(--line); padding: 14px 0 0; } /* (a divider now: the art-style tabs went on 21 Nov) */
.tabs button { padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }

/* grid */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.grid li { min-width: 0; }
.grid button { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: var(--mist); border-radius: 4px; }
.grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .9, .2, 1); }
.grid__hover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 18px; background: rgb(13 26 63 / .35); color: #fff; font-weight: 800; opacity: 0; transition: opacity .2s; }
@media (hover: hover) { .grid button:hover .grid__hover { opacity: 1; } .grid button:hover img { transform: scale(1.04); } }

.fine { margin-top: 30px; text-align: center; font-size: .8rem; color: var(--muted); }

/* post viewer */
dialog { border: 0; padding: 0; background: none; max-width: none; max-height: none; color: var(--ink); }
dialog::backdrop { background: rgb(8 12 30 / .82); }
.post { width: 100vw; height: 100dvh; display: grid; place-items: center; }
.post:not([open]) { display: none; }
.post__card { display: grid; grid-template-columns: minmax(0, auto) 340px; width: min(1020px, calc(100vw - 120px)); max-height: calc(100dvh - 60px); background: #fff; border-radius: 12px; overflow: hidden; }
.post__pic { background: #000; display: grid; place-items: center; min-width: 0; }
.post__pic img { max-height: calc(100dvh - 60px); width: auto; object-fit: contain; }
.post__side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); }
.post__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.post__talk { flex: 1; overflow-y: auto; padding: 14px 16px; display: grid; align-content: start; gap: 14px; font-size: .93rem; line-height: 1.4; }
.post__talk p { display: flex; gap: 10px; }
.post__talk small { display: block; margin-top: 4px; color: var(--muted); font-size: .75rem; }
.post__foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.like svg { width: 28px; height: 28px; fill: none; stroke: var(--ink); stroke-width: 2; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.like[aria-pressed="true"] svg { fill: #ff3b5c; stroke: #ff3b5c; transform: scale(1.12); }
.post__x, .story__x { position: absolute; top: 14px; right: 18px; width: 44px; height: 44px; color: #fff; font-size: 1.4rem; }
.post__nav { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border-radius: 50%; background: #fff; font-size: 1.8rem; line-height: 1; padding-bottom: 4px; }
.post__nav--prev { left: 14px; } .post__nav--next { right: 14px; }
@media (max-width: 760px) {
  .post { place-items: start center; overflow-y: auto; }
  .post__card { grid-template-columns: 1fr; width: 100vw; max-height: none; border-radius: 0; margin-top: 56px; }
  .post__pic img { max-height: 70dvh; width: 100%; }
  .post__side { border-left: 0; }
  .post__nav { top: 28px; width: 38px; height: 38px; font-size: 1.5rem; background: rgb(255 255 255 / .9); }
  .post__nav--prev { left: 10px; } .post__nav--next { left: 56px; right: auto; }
  .post__x { top: 6px; right: 8px; }
}

/* story viewer */
.story { width: 100vw; height: 100dvh; display: grid; place-items: center; }
.story:not([open]) { display: none; }
.story::backdrop { background: rgb(8 12 30 / .94); }
.story__frame { position: relative; width: min(440px, 100vw, calc((100dvh - 24px) * 9 / 16)); aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #000; color: #fff; }
@media (max-width: 480px) { .story__frame { border-radius: 0; width: 100vw; height: 100dvh; aspect-ratio: auto; } }
.story__frame > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story__bars { position: absolute; z-index: 2; inset: 10px 10px auto; display: flex; gap: 4px; }
.story__bars li { flex: 1; height: 3px; border-radius: 3px; background: rgb(255 255 255 / .35); overflow: hidden; }
.story__bars i { display: block; height: 100%; width: 0; background: #fff; }
.story__bars i.done { width: 100%; }
.story__bars i.run { animation: bar var(--t) linear forwards; }
@keyframes bar { to { width: 100%; } }
.story__head { position: absolute; z-index: 2; inset: 22px 10px auto; display: flex; align-items: center; gap: 8px; font-size: .9rem; text-shadow: 0 1px 4px rgb(0 0 0 / .5); }
.story__head span { opacity: .8; }
.story__head .story__x { position: static; margin-left: auto; }
.story__cap { position: absolute; z-index: 2; inset: auto 14px 22px; padding: 10px 14px; border-radius: 14px; background: rgb(13 26 63 / .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-weight: 600; line-height: 1.35; }
.story__tap { position: absolute; z-index: 1; top: 0; bottom: 0; width: 40%; }
.story__tap--prev { left: 0; } .story__tap--next { right: 0; width: 60%; }

/* the crew tray: all nine friends, like the stories row at the top of the app */
/* (21 Nov, JC: the row "cuts off Turbo halfway … and Scratch on the other side": it was centred while wider than the page, so
   both ends were out of reach. Now it starts at the left, runs to a little room past the last friend, and snaps.) */
.tray { display: flex; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 16px;
  margin: 0 -16px 20px; padding: 2px 16px 18px; border-bottom: 1px solid var(--line); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tray::after { content: ""; flex: 0 0 2px; } /* keeps the room after the last friend in every browser */
.tray a { scroll-snap-align: start; }
.tray a:first-child { margin-left: auto; } .tray a:last-child { margin-right: auto; } /* centred only while the row fits */
.tray::-webkit-scrollbar { display: none; }
.tray a { flex: none; display: grid; justify-items: center; gap: 5px; width: 68px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.tray__ring { padding: 2.5px; border-radius: 50%; background: var(--ring); }
.tray__ring .ava { box-shadow: 0 0 0 3px #fff; }
.tray a[aria-current] { color: var(--ink); font-weight: 800; }
.tray a[aria-current] .tray__ring { background: var(--ink); }


/* followers / following */
.prof__stats button { font: inherit; color: inherit; padding: 0; cursor: pointer; }
.prof__stats button:hover { text-decoration: underline; text-underline-offset: 3px; }
.pbtn--sm { min-height: 32px; padding: 6px 14px; font-size: .84rem; }
.people { width: 100vw; height: 100dvh; display: grid; place-items: center; }
.people:not([open]) { display: none; }
.people__card { width: min(420px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 48px)); display: grid; grid-template-rows: auto 1fr; background: #fff; border-radius: 16px; overflow: hidden; }
.people__card header { display: flex; align-items: center; justify-content: center; position: relative; padding: 14px; border-bottom: 1px solid var(--line); }
.people__card h2 { font-size: 1rem; font-weight: 800; }
.people__x { position: absolute; right: 8px; top: 50%; translate: 0 -50%; width: 40px; height: 40px; font-size: 1.1rem; }
.people__card ul { overflow-y: auto; padding: 6px 0; }
.people__card li { display: flex; align-items: center; gap: 10px; padding: 8px 16px; }
.people__who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.people__who > span:last-child { display: grid; min-width: 0; font-size: .84rem; color: var(--muted); line-height: 1.3; }
.people__who b { color: var(--ink); font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.people__who:hover b { text-decoration: underline; }

/* your own comments */
.post__talk a:hover b { text-decoration: underline; }
.post__talk .mine small button { font-size: inherit; color: var(--muted); text-decoration: underline; padding: 0; }
.say { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); }
.say input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 8px 0; font-size: 16px; background: none; }
.say button { font-weight: 800; color: var(--accent); }
.say input:placeholder-shown + button { opacity: .4; pointer-events: none; }
