/* Server-rendered pages: the parts the old single-page app drew with scripts (menus,
   tabs, threads, forms, landing and reading pages). */

/* ─── bIQ ────────────────────────────────────────────────────────────────── */

abbr.biq {
  text-decoration: none;
  border: 0;
  white-space: nowrap;
  font-variant-ligatures: none;
  cursor: help;
}
.biq-b {
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.015em;
  margin-right: 0.035em;
}
/* Headings lighten the small "b" a touch. In body-size text it keeps the text's own colour:
   lightened inside grey text, it fell below 4.5:1. */
:is(h1, h2, h3) .biq-b { opacity: 0.86; }
a .biq, .tab .biq, .topnav-link .biq { cursor: inherit; }

/* ─── Chrome ─────────────────────────────────────────────────────────────── */

.bottomnav-list { grid-template-columns: repeat(5, 1fr); max-width: 32rem; }
.bottomnav-list .icon { width: 22px; height: 22px; }
.topbar-compose { display: none; }
.theme-form { display: inline-flex; }
.theme-sun { display: none; }
:root[data-theme='dark'] .theme-moon { display: none; }
:root[data-theme='dark'] .theme-sun { display: inline-block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-moon { display: none; }
  :root:not([data-theme]) .theme-sun { display: inline-block; }
}
/* The menu at the top right: Settings, Puzzles, and the theme, named for what it switches to. */
.topbar-menu > summary { list-style: none; cursor: pointer; }
.topbar-menu > summary::-webkit-details-marker { display: none; }
.topbar-menu-popup { top: 2.75rem; min-width: 12.5rem; }
.topbar-menu-popup .menu-item[aria-current='page'] { font-weight: 600; }
.theme-to-light { display: none; }
:root[data-theme='dark'] .theme-to-dark { display: none; }
:root[data-theme='dark'] .theme-to-light { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-to-dark { display: none; }
  :root:not([data-theme]) .theme-to-light { display: inline; }
}
.icon-btn.is-active { background: var(--surface-2); color: var(--ink); }

.flash {
  margin: 1rem auto 0;
  max-width: 42rem;
  padding: 0 1rem;
}
.flash p {
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--ink-2);
}
.flash-error p { box-shadow: inset 3px 0 0 var(--danger); color: var(--danger); }

.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.25rem 1rem 7rem; }
.site-footer-inner { margin: 0 auto; max-width: 64rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.8125rem; color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.site-footer-promise { display: block; margin-top: 0.875rem; color: var(--ink-2); }
.site-footer-promise a { text-decoration: underline; text-underline-offset: 0.18em; }

.section-title { margin: 2rem 0 0.75rem; font-family: var(--font-serif); font-size: 1.375rem; font-weight: 600; letter-spacing: -0.01em; }
.section-count { margin-left: 0.375rem; font-family: var(--font-sans); font-size: 0.9375rem; font-weight: 500; color: var(--muted); }
.feed-items { display: flex; flex-direction: column; gap: 0.75rem; }
.feed-more { margin-top: 1.25rem; display: flex; justify-content: center; }
.feed-end { text-align: center; color: var(--muted); font-size: 0.875rem; }
.feed-footer { margin-top: 1.25rem; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.feed-tabs { flex: 1; max-width: 20rem; }
.explore-tabs { margin: 1.25rem 0 1rem; max-width: 30rem; }
.tab { text-decoration: none; }

.new-posts {
  position: sticky;
  top: 4.25rem;
  z-index: 30;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  background: var(--ink);
  color: var(--surface);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}
.new-posts[hidden] { display: none; }
.new-posts-up { transform: rotate(90deg); }

.pager { margin-top: 1.5rem; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.75rem; }
.pager > :last-child { justify-self: end; }
.pager-page { font-size: 0.875rem; color: var(--muted); }

/* ─── Cards (menus without a script) ─────────────────────────────────────── */

details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu:not([open]) > .menu-popup { display: none; }
details.menu[open] > summary { background: var(--surface-2); color: var(--ink); }
.menu-item .icon { flex-shrink: 0; }
.post-tombstone { padding: 0.875rem 1rem; }
.tombstone-text { font-size: 0.9375rem; font-style: italic; color: var(--muted); }
.post-body { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.action-preview { margin: 1rem 0 1.25rem; pointer-events: none; }
.action-preview .post-actions, .action-preview details.menu { display: none; }

/* ─── The conversation above a reply ─────────────────────────────────────── */

.thread-context { margin-bottom: 0.75rem; }
.ancestors { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ancestor { position: relative; padding: 0 0 0.75rem 1.25rem; }
.ancestor::before { content: ''; position: absolute; left: 0.3125rem; top: 0.375rem; bottom: -0.375rem; width: 2px; border-radius: 1px; background: var(--line-strong); }
.ancestor::after { content: ''; position: absolute; left: 0; top: 0.3125rem; width: 0.75rem; height: 0.75rem; border-radius: 9999px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-strong); }
.ancestor-link { display: flex; flex-direction: column; gap: 0.125rem; border-radius: 0.625rem; padding: 0.125rem 0.5rem; }
.ancestor-link:hover { background: var(--surface-2); }
.ancestor-who { font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
.ancestor-handle { font-weight: 400; color: var(--muted); }
.ancestor-text { font-size: 0.875rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ancestor-deleted { font-size: 0.875rem; font-style: italic; color: var(--muted); }
.ancestor-gap { color: var(--muted); padding-bottom: 0.5rem; }

/* ─── Replies ────────────────────────────────────────────────────────────── */

.replies { margin-top: 1.5rem; }
.replies-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.replies-list > .post { border-bottom: 1px solid var(--line); }
.replies-empty, .reply-signin { color: var(--muted); font-size: 0.9375rem; padding: 0.75rem 0; }
.replies-more { margin-top: 1rem; display: flex; justify-content: center; }
/* Replies and retakes: two tabs under the post, each with its count. */
.conversation-tabs { margin-bottom: 0.75rem; }
.conversation-tabs .tab { font-size: 0.9375rem; font-weight: 600; }
.tab-count { font-weight: 500; color: var(--muted); }
.replies[aria-busy="true"] { opacity: 0.6; transition: opacity 0.15s 0.1s; }
/* A post's retakes: each a card of its own, one link that opens it, its words beside a
   thumbnail of its video or first picture. */
.retakes-list { display: flex; flex-direction: column; gap: 0.625rem; }
.retake-tile { display: flex; gap: 0.875rem; padding: 0.875rem 1rem; color: inherit; transition: background-color 0.15s; }
.retake-tile:hover { background: var(--surface-2); }
.retake-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.retake-tile-main { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 0.5rem; }
.retake-tile-head { display: flex; min-width: 0; align-items: center; gap: 0.5rem; }
.retake-tile-who { display: flex; min-width: 0; flex-direction: column; line-height: 1.25; }
.retake-tile-line { display: flex; min-width: 0; align-items: center; gap: 0.25rem; }
.retake-tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9375rem; font-weight: 600; color: var(--ink); unicode-bidi: isolate; }
.retake-tile-meta { display: flex; min-width: 0; gap: 0.25rem; font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }
.retake-tile-handle { overflow: hidden; text-overflow: ellipsis; }
.retake-tile-body {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  unicode-bidi: plaintext;
  color: var(--ink);
}
.retake-tile-counts { margin-top: auto; display: flex; align-items: center; gap: 0.875rem; font-size: 0.8125rem; color: var(--muted); }
.retake-tile-count { display: inline-flex; align-items: center; gap: 0.3rem; }
.retake-tile-thumb {
  position: relative;
  display: grid;
  flex-shrink: 0;
  align-self: flex-start;
  place-items: center;
  width: 5.5rem;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0.75rem;
  color: #fff;
}
.retake-tile-thumb.is-take { width: 4.75rem; aspect-ratio: 9 / 16; }
.retake-tile-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.retake-tile-thumb.is-covered { background-image: linear-gradient(rgb(0 0 0 / 0.35), rgb(0 0 0 / 0.35)); }
.retake-tile-badge { position: absolute; left: 0.3125rem; top: 0.3125rem; display: grid; place-items: center; width: 1.375rem; height: 1.375rem; border-radius: 9999px; background: rgb(0 0 0 / 0.55); }
.retake-tile-time, .retake-tile-more {
  position: absolute;
  right: 0.3125rem;
  bottom: 0.3125rem;
  border-radius: 0.375rem;
  padding: 0 0.3125rem;
  background: rgb(0 0 0 / 0.6);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.125rem;
}
.char-count { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.char-count.is-over { color: var(--danger); }
.related { margin-top: 2rem; }
.back-link { margin-bottom: 0.5rem; }

/* ─── The split ──────────────────────────────────────────────────────────── */
/* Its tabs and panels are in split.css, with the details they share their look with. */

.split { margin-top: 1.5rem; }

/* ─── Landing ────────────────────────────────────────────────────────────── */

.landing { border-bottom: 1px solid var(--line); background: radial-gradient(120% 90% at 50% 0%, var(--surface) 0%, var(--page) 70%); }
.landing-inner { margin: 0 auto; max-width: 42rem; padding: 3rem 1rem 2.5rem; }
.landing-kicker { display: inline-flex; align-items: center; gap: 0.625rem; font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
.landing-title { margin-top: 1rem; font-family: var(--font-serif); font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; text-wrap: balance; }
.landing-lede { margin-top: 1rem; font-size: 1.125rem; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.landing-lede a { text-decoration: underline; text-underline-offset: 0.2em; }
.landing-actions { margin-top: 1.5rem; }

/* ─── Reading pages (bIQ, the manual) ────────────────────────────────────── */

.prose { font-size: 1.0625rem; line-height: 1.7; color: var(--ink); }
.prose h1 { font-family: var(--font-serif); font-size: 2.25rem; line-height: 1.15; font-weight: 600; letter-spacing: -0.025em; margin-bottom: 0.75rem; }
.prose h2 { font-family: var(--font-serif); font-size: 1.5rem; line-height: 1.25; font-weight: 600; margin: 2.25rem 0 0.75rem; letter-spacing: -0.01em; }
.prose h3 { font-size: 1.125rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.prose h4 { font-weight: 600; margin: 1.25rem 0 0.5rem; }
.prose p, .prose ul, .prose ol, .prose table, .prose pre, .prose blockquote { margin: 0.75rem 0; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.375rem; }
.prose a { color: var(--link); text-decoration: underline; text-underline-offset: 0.18em; }
.prose code { font-family: var(--font-mono); font-size: 0.875em; background: var(--surface-2); border-radius: 0.3rem; padding: 0.05em 0.3em; }
.prose pre { overflow-x: auto; background: var(--surface-2); border-radius: 0.75rem; padding: 0.875rem 1rem; }
.prose pre code { background: none; padding: 0; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.875rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 0.375rem 0.625rem; text-align: left; vertical-align: top; }
.prose th { font-weight: 600; }
.prose blockquote { border-left: 3px solid var(--line-strong); padding-left: 1rem; color: var(--ink-2); }
.prose .lede { font-size: 1.1875rem; }
.prose .anchor { float: left; margin-left: -1.1em; width: 1em; opacity: 0; color: var(--muted); text-decoration: none; font-weight: 400; }
.prose h1:hover .anchor, .prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: 1; }
.toc { margin: 1.25rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.toc a { border-radius: 9999px; background: var(--surface-2); padding: 0.25rem 0.75rem; font-size: 0.875rem; text-decoration: none; color: var(--ink-2); }
.breadcrumb { font-size: 0.875rem; color: var(--muted); margin-bottom: 1rem; }
.biq-manual-link { margin-top: 2rem; }

/* ─── Forms and small pages ──────────────────────────────────────────────── */

/* The kind switch's radios are visually hidden: the ring goes round the whole segment. */
.segment:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
@supports not selector(:has(a)) {
  .segment input:focus-visible + * { outline: 2px solid var(--focus); }
}
.settings { display: flex; flex-direction: column; gap: 1rem; }
.settings-section { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }
.settings-section h2 { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; }
.settings-value { font-size: 0.9375rem; color: var(--ink); }
.danger-zone { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--danger) 35%, transparent); }
.error-page { text-align: center; padding: 3rem 0; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.error-code { font-family: var(--font-serif); font-size: 3.5rem; line-height: 1; font-weight: 600; color: var(--muted); }
.people { list-style: none; margin: 1rem 0 0; padding: 0.25rem 0; }
.person-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem; }
.person-link:hover { background: var(--surface-2); }
.profile-name { font-size: 1.75rem; }
.profile-stats { margin-top: 0.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; font-size: 0.875rem; color: var(--muted); }
.profile-stats strong { color: var(--ink); }
.player-page { max-width: 48rem; }

@media (min-width: 640px) {
  .topbar-compose { display: inline-flex; }
  .site-footer { padding-bottom: 2rem; }
  .landing-inner { padding: 4.5rem 1rem 3.5rem; }
}
