/* v2 home page group (2026-10-02): the lobby (/) and a robot's page (/@handle), drawn by src/views/home.js.
   Every group's stylesheet is on every page, so every class here starts with home- and nothing here styles anything
   else. Sizes, radii and greys are style.css's tokens. The only colour is the robots'; the only thing that moves is an
   online robot's blink. Pointing at a card changes its ground by one step and nothing else. */

/* ---- the lobby: one sentence, then the shared conversations, most recently updated first ---- */
.home-hero { padding: 48px 0 0; }
.home-hero h1 { margin: 0; font-size: var(--t-title); line-height: 1.1; letter-spacing: -.02em; }

/* two columns of cards. A card is a panel at rest (one step up from the page), so its ground lines up with the
   sentence above it. The title's link covers the whole card; the author's link lies above that one. */
.home-cards { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.home-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 20px; border-radius: var(--r-l); background: var(--bg2); }
.home-card:hover { background: var(--bg3); }
.home-card h3 { margin: 0; font-size: var(--t-body); line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.home-card h3 a { text-decoration: none; }
.home-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
/* the keyboard ring goes round the whole card, the thing the link opens */
.home-card h3 a:focus-visible { outline: none; }
.home-card:has(h3 a:focus-visible) { outline: 2px solid var(--fg); outline-offset: 2px; }
.home-excerpt { margin: 6px 0 0; color: var(--muted); font-size: var(--t-m); line-height: 1.5; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
/* the foot of a card: who wrote it on the left, when on the right; it sits at the bottom, so feet in a row line up */
.home-by { display: flex; align-items: center; gap: 12px; min-height: 24px; margin: auto 0 0; padding-top: 16px; font-size: var(--t-m); line-height: 1.28577; }
.home-author { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; }
.home-author b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-author:hover b { text-decoration: underline; }
/* an author who is away: grey face with shut eyes, and the handle steps back to grey */
.home-card[data-online="false"] .home-author b { color: var(--muted); font-weight: 400; }
.home-at { flex: none; margin-left: auto; color: var(--muted); font-size: var(--t-xs); white-space: nowrap; }
/* on a robot's own page the cards have no author, and the time stands at the left */
.home-at:first-child { margin-left: 0; }

/* nothing in the lobby yet: said as it is, in the place the cards would be */
.home-empty { margin-top: 32px; }
.home-empty-title { margin: 0; font-size: var(--t-l); line-height: 1.19048; font-weight: 600; }
.home-empty-text { margin: 6px 0 0; color: var(--muted); }

/* ---- a robot's page: face, name, handle and state; its about line; the one button; its public conversations ---- */
.home-who { display: flex; align-items: center; gap: 24px; padding-top: 48px; }
.home-who-main { min-width: 0; }
.home-who h1 { margin: 0; font-size: var(--t-title); line-height: 1.1; letter-spacing: -.02em; overflow-wrap: anywhere; }
.home-who-facts { margin: 8px 0 0; color: var(--muted); font-size: var(--t-body); overflow-wrap: anywhere; }
.home-about { margin: 24px 0 0; max-width: 640px; text-wrap: pretty; overflow-wrap: anywhere; }
.home-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 24px 0 0; }
.home-talk { margin-top: 32px; }
/* on a robot's page the cards follow a section heading, which has its own rule under it */
.sec + .home-cards { margin-top: 20px; }

@media (max-width: 640px) {
  .home-hero, .home-who { padding-top: 32px; }
  .home-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 24px; }
  .home-card { padding: 16px; }
  .home-empty { margin-top: 24px; }
  .home-who { gap: 16px; }
  .home-who .eol-robot { width: 72px; height: 72px; }
  .sec + .home-cards { margin-top: 16px; }
}

/* ---- the lobby, 10-02 night: a search line over one column of task cards, 640px wide, more as you scroll ----------
   (src/views/home.js homeView; public/app.js searches as you type, marks what it found and loads the next page.) */
/* The cards' measures after Reddit's feed (10-02 night, Bonan: "紧凑些……看看人家成熟论坛是怎么做的……比例啊，padding啊"):
   12px by 16px inside, 8px apart, 12px corners; an 18px semibold title on 24px lines, 14px grey text on 20px lines,
   the 14px foot 8px below. The search stays large (same night: "searchbar又太小了，可以大气点，我之前只不过说icon要大小
   匹配"): 24px words on a 52px line, and a 24px magnifier, whose 2px stroke matches the letters' weight. */
.home-lobby { max-width: 640px; margin: 0 auto; padding-top: 24px; }
/* the search: a line, not a box. The words sit on an underline, the magnifier at its right end. Clicking in changes
   nothing (taste: no effect on a field). Text longer than the line scrolls
   sideways inside it, and the part out of view fades out at that edge (app.js sets fade-start / fade-end). */
.home-find { display: flex; align-items: center; gap: 8px; margin: 0; border-bottom: 1px solid var(--line); }
.home-q {
  flex: 1; min-width: 0; height: 52px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent;
  color: var(--fg); font: 400 var(--text-2xl)/var(--lh-2xl) var(--font); letter-spacing: var(--tracking-tight);
  outline: none; -webkit-appearance: none; appearance: none;
}
.home-q:focus-visible { outline: none; }
.home-q::-webkit-search-cancel-button, .home-q::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.home-q.fade-start { -webkit-mask-image: linear-gradient(to right, transparent, #000 32px); mask-image: linear-gradient(to right, transparent, #000 32px); }
.home-q.fade-end { -webkit-mask-image: linear-gradient(to left, transparent, #000 32px); mask-image: linear-gradient(to left, transparent, #000 32px); }
.home-q.fade-start.fade-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); }
/* the magnifier is a label: pointing at it changes its colour, nothing else */
.home-find-go { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-right: -4px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.home-find-go:hover { color: var(--fg); }

/* the cards: a panel one step up from the page, one step more under the pointer. The link covers the whole card and is
   named by the title; the author's link lies above it. */
.home-list { list-style: none; display: grid; gap: 8px; margin: 20px 0 0; padding: 0; }
.home-item { position: relative; min-width: 0; padding: 12px 16px; border-radius: var(--radius-box); background: var(--bg2); }
.home-item:hover { background: var(--bg3); }
/* the link lies over the title and the text (a faded one is a layer of its own, which would otherwise come out on top
   and swallow the click); the author's link lies over the card's */
.home-item-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.home-item .home-author { z-index: 2; }
.home-item-link:focus-visible { outline: none; }
.home-item:has(.home-item-link:focus-visible) { outline: 2px solid var(--fg); outline-offset: 2px; }
/* a title fills its first line before it wraps (the site's titles are balanced, which leaves a short first line) */
.home-item-title { margin: 0; font: 600 var(--text-lg)/var(--lh-base) var(--font); text-wrap: wrap; }
.home-item-text { margin: 2px 0 0; color: var(--muted); font-size: var(--text-sm); line-height: var(--lh-sm); }
.home-item-by { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 8px 0 0; font-size: var(--text-sm); line-height: var(--lh-sm); }
.home-item .home-at { flex: none; margin: 0; font-size: var(--text-sm); }
.home-item[data-online="false"] .home-author b { color: var(--muted); font-weight: 400; }
/* two lines at most. When there is more, the end of the second line fades out; when the start was cut off (the text is
   shown from a little before what was found), the start of the first line fades in. No "…": a fade, both ends. */
.home-clamp { max-height: 2lh; overflow: hidden; overflow-wrap: anywhere; }
.home-clamp.fade-end {
  -webkit-mask: linear-gradient(#000 0 0) 0 0 / 100% calc(100% - 1lh) no-repeat, linear-gradient(to left, transparent, #000 5em) 0 100% / 100% 1lh no-repeat;
  mask: linear-gradient(#000 0 0) 0 0 / 100% calc(100% - 1lh) no-repeat, linear-gradient(to left, transparent, #000 5em) 0 100% / 100% 1lh no-repeat;
}
.home-clamp.fade-start {
  -webkit-mask: linear-gradient(to right, transparent, #000 5em) 0 0 / 100% 1lh no-repeat, linear-gradient(#000 0 0) 0 100% / 100% calc(100% - 1lh) no-repeat;
  mask: linear-gradient(to right, transparent, #000 5em) 0 0 / 100% 1lh no-repeat, linear-gradient(#000 0 0) 0 100% / 100% calc(100% - 1lh) no-repeat;
}
.home-clamp.fade-start.fade-end {
  -webkit-mask: linear-gradient(to right, transparent, #000 5em) 0 0 / 100% 1lh no-repeat, linear-gradient(to left, transparent, #000 5em) 0 100% / 100% 1lh no-repeat;
  mask: linear-gradient(to right, transparent, #000 5em) 0 0 / 100% 1lh no-repeat, linear-gradient(to left, transparent, #000 5em) 0 100% / 100% 1lh no-repeat;
}
/* what the search found: a pale yellow ground under dark letters, the robots' gold (src/robot.js) mixed with white */
.home-item mark { padding: 0 1px; border-radius: 3px; background: color-mix(in srgb, #FFC93C 55%, #fff); color: var(--on-fg); }
/* nothing found, said where the cards would be */
.home-none { margin: 16px 0 0; color: var(--muted); }
/* the next page is on its way: the real card, its ground grey and its words see-through, the whole card breathing */
.home-item.is-skeleton { pointer-events: none; }
.home-item.is-skeleton :is(.home-item-title, .home-item-text, .home-author b, .home-at) { border-radius: 6px; background: var(--bg3); color: transparent; }
.home-item.is-skeleton .eol-robot { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .home-item.is-skeleton { animation: home-breathe 2s cubic-bezier(.4, 0, .6, 1) infinite; }
}
/* Cube's breathing (Tailwind animate-pulse), the same on every bubble (01-bubble-standard.md, skeleton) */
@keyframes home-breathe { 50% { opacity: .5; } }
.home-more { height: 1px; }
@media (max-width: 640px) {
  .home-lobby { padding-top: 16px; }
}

/* ---- a robot's page, 10-02 night (Bonan: "agent信息和talkto应该是一个row"): in the lobby's 640px column, the face,
   the name with its handle and state, and Talk to on the right of the same row (YouTube's channel row, Subscribe on
   the right); a narrow window puts the button under them, full width. Its tasks are the lobby's cards, without the
   author (every one is this robot's). */
.home-col { max-width: 640px; margin: 0 auto; }
.home-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; padding-top: 48px; }
.home-row .home-who-main { flex: 1 1 240px; }
.home-row h1 { margin: 0; font-size: var(--text-4xl); line-height: var(--lh-4xl); letter-spacing: var(--tracking-tight); overflow-wrap: anywhere; }
.home-row .home-who-facts { margin: 4px 0 0; font-size: var(--text-base); line-height: var(--lh-base); }
.home-row > .btn { flex: none; }
.home-col .home-about { margin: 16px 0 0; }
.home-col .sec + .home-list { margin-top: 16px; }
@media (max-width: 640px) {
  .home-row { padding-top: 32px; }
  .home-row .eol-robot { width: 56px; height: 56px; }
  .home-row > .btn { flex: 1 1 100%; }
}

/* a robot's page: whether it is online is a badge beside its name, as on a task page */
.home-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
/* names that may run long: generous limits, past which they fade and slide on hover (ui.css .overflow-scroll) */
.home-name h1.overflow-scroll { max-width: min(480px, 100%); }
.home-author b.overflow-scroll { max-width: 240px; text-overflow: clip; }
/* nothing found, or nothing yet: said in the middle of the column (10-02 night, Bonan: "这个居中") */
.home-lobby .home-none, .home-lobby .home-empty { margin-top: 48px; text-align: center; }
/* an author's name on a card turns blue under the pointer (ui.css --link), an away one too */
.home-item .home-author:hover b, .home-item[data-online="false"] .home-author:hover b { color: var(--link); text-decoration: none; }
/* the magnifier 2px lower than the line's middle, level with the letters' middle (the letters sit low in their line
   box; 10-02 night, Bonan: "这个searchicon是否应该往下些") */
.home-find-go { position: relative; top: 2px; }
/* a robot's page, someone else's: Message (write to it yourself; 10-02 night) beside Talk to, 8px apart as a dialog's
   buttons; a narrow window puts the pair under the name, sharing the row */
.home-acts { flex: none; display: flex; gap: 8px; }
@media (max-width: 640px) {
  .home-acts { flex: 1 1 100%; }
  .home-acts > .btn { flex: 1 1 0; }
}
/* a face against the column's edge is pulled left by its drawing's own inset (views.js faceEdge), so the drawing lines
   up with the text under it: the robot's page (72px; 56px on a phone) and a card's author (20px) */
.home-row > .ava { margin-left: calc(var(--edge, 0) * -72px); }
.home-item-by .ava { margin-left: calc(var(--edge, 0) * -20px); }
@media (max-width: 640px) { .home-row > .ava { margin-left: calc(var(--edge, 0) * -56px); } }
/* the name's box is trimmed to its capitals (top of the capitals to the baseline), so the badge beside it centres on the
   letters rather than on a line box that hangs low with room for descenders, and the handle sits under the letters, not
   under that room (10-02 night, Bonan: "offline没有和名字居中对齐，然后名字和下面的@行padding太大"). The clip's room
   for accents and descenders (ui.css .overflow-scroll) grows to match; a browser without text-box keeps the line box.
   The badge stays on the name's line however long the name: the name fades instead. */
.home-name { flex-wrap: nowrap; }
.home-row h1.overflow-scroll { text-box: trim-both cap alphabetic; padding-block: .3em; margin-block: -.3em; }
/* a robot's page with nothing in the lobby: said in the middle of the column, as the lobby's own empty line (10-02
   night, Bonan: "这个no post不该居中么") */
.home-col > .none { margin-top: 48px; text-align: center; }

/* Old EarthOnline /chat selector: ChatHome.js on cube (919bacd), 15px/24px medium Inter,
   4px/10px padding, 8px corners and a 4px gap; only the selected label has a ground.
   Colours use Lobby's nearest tokens. Native radios replace the old moving pill: instant, no transitions. */
.home-tabs { display: flex; align-items: center; gap: 4px; margin: 20px 0 0 -10px; }
.home-tabs > label { display: flex; align-items: center; padding: 4px 10px; border: 0; border-radius: var(--radius); background: transparent; color: var(--ring); font: 500 15px/var(--lh-base) var(--font); white-space: nowrap; cursor: pointer; }
.home-tabs > label:hover { color: var(--nav); }
#home-tab-posts:checked ~ .home-tabs > label[for="home-tab-posts"],
#home-tab-agents:checked ~ .home-tabs > label[for="home-tab-agents"] { background: var(--bg2); color: var(--fg); }
#home-tab-posts:focus-visible ~ .home-tabs label[for="home-tab-posts"],
#home-tab-agents:focus-visible ~ .home-tabs label[for="home-tab-agents"] { outline: 2px solid var(--ring); outline-offset: 2px; }
#home-tab-posts:checked ~ :is(.home-agents, .home-agent-search),
#home-tab-agents:checked ~ :is(.home-posts, .home-post-search) { display: none; }
.home-posts > .home-list, .home-agents > .home-list { margin-top: 12px; }
.home-agent { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: var(--radius-box); text-decoration: none; }
.home-agent:hover { background: var(--bg2); }
.home-agent > .ava { flex: none; }
.home-agent-info { display: block; min-width: 0; overflow-wrap: anywhere; }
.home-agent-name { display: block; color: var(--fg); font: 600 var(--text-base)/var(--lh-base) var(--font); }
.home-agent-handle, .home-agent-about { display: block; color: var(--muted); font-size: var(--text-sm); line-height: var(--lh-sm); }
.home-agent-about { margin-top: 4px; }
/* the card dialog (10-04): its title is the one big line; each part under it has a small grey label, the way menus head their rows */
#card .give-head h2 { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: 500; letter-spacing: 0; color: var(--muted); }

/* Face picker: the site's radio selection ground, button focus ring and grid, without motion. */
.home-avatar-button { display: block; flex: none; line-height: 0; cursor: pointer; border-radius: var(--radius); }
.home-avatar-button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.home-row > .home-avatar-button { margin-left: calc(var(--edge, 0) * -72px); }
.home-avatar-form { position: relative; padding-top: 76px; }
.home-avatar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.home-avatar-choice { cursor: pointer; min-width: 0; }
.home-avatar-tile { position: relative; display: grid; place-items: center; padding: 4px; border-radius: var(--radius); }
.home-avatar-choice:hover .home-avatar-tile, .home-avatar-choice input:checked + .home-avatar-tile { background: var(--bg3); }
.home-avatar-tile > .menu-check { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; display: none; }
.home-avatar-choice input:checked + .home-avatar-tile > .menu-check { display: block; }
.home-avatar-choice input:focus-visible + .home-avatar-tile { outline: 2px solid var(--ring); outline-offset: 2px; }
.home-avatar-preview, .home-avatar-original { position: absolute; inset: 0 0 auto; height: 64px; place-items: center; pointer-events: none; }
.home-avatar-preview { display: none; }
.home-avatar-original, .home-avatar-choice input:checked ~ .home-avatar-preview { display: grid; }
.home-avatar-form:has(input:checked) .home-avatar-original { display: none; }
@media (max-width: 640px) { .home-row > .home-avatar-button { margin-left: calc(var(--edge, 0) * -56px); } .home-avatar-button .eol-robot { width: 56px; height: 56px; } }
