/* black + white only. type and spacing follow X's dark theme. */
:root {
  --bg: #000;
  --fg: #e7e9ea;
  --white: #fff;
  --mute: #71767b;
  --line: #2f3336;
  --thread: #333639;
  --hover: rgba(231, 233, 234, .1);
  --row: rgba(255, 255, 255, .03);
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/20px var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--white); color: #000; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }

/* ---------- buttons ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 24px; border-radius: 9999px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; line-height: 20px; white-space: nowrap; transition: background-color .2s;
}
.pill.white { background: #eff3f4; color: #0f1419; }
.pill.white:hover { background: #d7dbdc; }
.pill.line { border-color: #536471; color: var(--fg); }
.pill.line:hover { background: var(--hover); }
.pill.lg { height: 52px; font-size: 17px; }
.pill.sm { height: 32px; padding: 0 16px; font-size: 14px; }
.pill .ca-text { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.pill .hint { color: var(--mute); font-weight: 500; }
.pill:disabled { cursor: default; }
.pill.line:disabled:hover { background: none; }

/* ---------- home: first screen (X sign-in layout) ---------- */
.land { min-height: 100svh; display: flex; align-items: center; }
.land-mark { flex: 1 1 55%; display: flex; align-items: center; justify-content: center; padding: 32px; }
.land-mark img { width: 100%; max-width: 380px; height: auto; }
.land-main { flex: 1 1 45%; min-width: 0; padding: 16px; }
.land h1 { font-size: 64px; line-height: 84px; font-weight: 800; letter-spacing: -.02em; margin: 48px 0; }
.land h2 { font-size: 31px; line-height: 36px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 32px; }
.stack { width: 300px; display: flex; flex-direction: column; gap: 12px; }
.or { display: flex; align-items: center; gap: 4px; color: var(--fg); font-size: 15px; margin: 4px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.or span { padding: 0 4px; }
.fine { width: 300px; margin-top: 8px; font-size: 11px; line-height: 14px; color: var(--mute); }
.fine a, .fine b { color: var(--fg); font-weight: 400; }
.fine a:hover { text-decoration: underline; }
.ca { width: 300px; margin-top: 60px; }
.ca h3 { font-size: 17px; line-height: 20px; font-weight: 700; margin-bottom: 20px; }
.ca .pill { width: 100%; }

/* ---------- timeline column (home: how it works / example / about) ---------- */
.tl { max-width: 600px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-top: 1px solid var(--line); }
.tl-head { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tl-head h2 { font-size: 20px; line-height: 24px; font-weight: 800; }
.tl-head p { color: var(--mute); font-size: 13px; line-height: 16px; margin-top: 2px; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.steps .n { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; }
.steps b { display: block; font-weight: 700; }
.steps p { color: var(--mute); }
.steps code { font: inherit; color: var(--fg); }
.tl-act { padding: 16px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tl-act span { color: var(--mute); font-size: 13px; }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.facts time { color: var(--mute); }
.src { padding: 12px 16px; color: var(--mute); font-size: 13px; line-height: 16px; border-bottom: 1px solid var(--line); }
.src a { color: var(--fg); }
.src a:hover { text-decoration: underline; }
.more-link { display: block; padding: 16px; font-weight: 500; border-bottom: 1px solid var(--line); transition: background-color .2s; }
.more-link:hover { background: var(--row); }

/* footer links, X style */
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding: 12px 16px; color: var(--mute); font-size: 13px; line-height: 16px; }
.foot a:hover { text-decoration: underline; }
.home .foot { padding: 32px 16px 40px; }

/* ---------- post (shared: feed + example) ---------- */
.tw { display: block; padding: 12px 16px 0; border-bottom: 1px solid var(--line); transition: background-color .2s; }
.feed .tw:hover { background: var(--row); }
.row { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; }
.rail { display: flex; flex-direction: column; align-items: center; }
.rail .ln { flex: 1; width: 2px; background: var(--thread); margin-top: 4px; min-height: 8px; }
.body { min-width: 0; padding-bottom: 12px; }
.av { width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden; background: #333; }
.av img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.av.gork { background: #000; border: 1px solid var(--line); display: grid; place-items: center; }
.av.gork img { width: 22px; height: 22px; filter: none; }
.head { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; }
.head b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.head .m { color: var(--mute); overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.head .dot { color: var(--mute); flex: none; }
.head .t { color: var(--mute); flex: none; }
.head a.t:hover { text-decoration: underline; }
.vf { width: 18px; height: 18px; flex: none; }
.auto { display: flex; align-items: center; gap: 4px; color: var(--mute); font-size: 13px; line-height: 16px; margin-top: 2px; }
.auto svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.rep { color: var(--mute); margin-top: 2px; }
.rep a, .txt a { color: var(--fg); font-weight: 500; }
.rep a:hover, .txt a:hover { text-decoration: underline; }
.txt { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.acts { display: flex; justify-content: space-between; max-width: 425px; margin: 12px 0 0 -8px; color: var(--mute); font-size: 13px; line-height: 16px; }
.acts > * { display: flex; align-items: center; gap: 0; min-width: 0; }
.acts .ic { width: 34px; height: 34px; margin: -8px 0; display: grid; place-items: center; border-radius: 9999px; transition: background-color .2s, color .2s; }
.acts svg { width: 18.75px; height: 18.75px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.acts a:hover { color: var(--fg); }
.acts a:hover .ic { background: var(--hover); }

/* ---------- replies page: X three-column layout ---------- */
.app { display: flex; justify-content: center; min-height: 100svh; }
.nav { width: 275px; flex: none; height: 100svh; position: sticky; top: 0; padding: 0 12px; display: flex; flex-direction: column; align-items: flex-start; }
.nav-logo { width: 52px; height: 52px; border-radius: 9999px; display: grid; place-items: center; margin: 2px 0 4px; transition: background-color .2s; }
.nav-logo:hover { background: var(--hover); }
.nav-logo img { width: 30px; height: 30px; }
.nav .item { display: inline-flex; align-items: center; padding: 12px 16px; margin: 2px 0; border-radius: 9999px; font-size: 20px; line-height: 24px; transition: background-color .2s; }
.nav .item:hover { background: var(--hover); }
.nav .item.on { font-weight: 700; }
.nav .post { width: 90%; margin-top: 16px; }
.col { width: 600px; flex: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 100svh; }
.col-head { position: sticky; top: 0; z-index: 5; background: rgba(0, 0, 0, .65); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.col-title { padding: 0 16px; height: 53px; display: flex; flex-direction: column; justify-content: center; }
.col-title h1 { font-size: 20px; line-height: 24px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.col-title p { color: var(--mute); font-size: 13px; line-height: 16px; }
.tag { padding: 0 8px; border: 1px solid var(--line); border-radius: 9999px; color: var(--mute); font-size: 12px; line-height: 20px; font-weight: 500; }
.tabs { display: flex; }
.tabs button { flex: 1; height: 53px; color: var(--mute); font-weight: 500; transition: background-color .2s; }
.tabs button:hover { background: var(--hover); }
.tabs button span { position: relative; display: inline-flex; height: 53px; align-items: center; }
.tabs button.on { color: var(--fg); font-weight: 700; }
.tabs button.on span::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 9999px; background: var(--white); }
.newpill { position: sticky; top: 120px; z-index: 4; display: none; margin: 12px auto -52px; padding: 0 16px; height: 40px; border-radius: 9999px; background: #eff3f4; color: #0f1419; font-weight: 700; box-shadow: 0 0 12px rgba(255, 255, 255, .15); }
.newpill.show { display: flex; align-items: center; }
.more { padding: 24px 16px; text-align: center; color: var(--mute); }
.spin { width: 26px; height: 26px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--fg); animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 32px 16px; text-align: left; max-width: 400px; margin: 0 auto; }
.empty b { display: block; color: var(--fg); font-size: 31px; line-height: 36px; font-weight: 800; margin-bottom: 8px; }

.side { width: 350px; flex: none; padding: 12px 0 64px 30px; }
.side-in { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 16px; }
.box { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.box h2 { padding: 12px 16px; font-size: 20px; line-height: 24px; font-weight: 800; }
.box p.txt2 { padding: 0 16px 12px; }
.box .pad { padding: 0 16px 16px; }
.box .pad .pill { width: 100%; }
.trend { padding: 12px 16px; transition: background-color .2s; }
.trend:hover { background: var(--row); }
.trend span { display: block; color: var(--mute); font-size: 13px; line-height: 16px; }
.trend b { display: block; font-size: 20px; line-height: 24px; font-weight: 800; margin: 2px 0; font-variant-numeric: tabular-nums; }
.side .foot { justify-content: flex-start; padding: 0 16px; }

.mstats { display: none; border-bottom: 1px solid var(--line); }
.mstats div { flex: 1; padding: 12px 8px; text-align: center; }
.mstats b { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.mstats span { color: var(--mute); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .nav { width: 200px; } .nav .item { font-size: 17px; padding: 10px 14px; } }
@media (max-width: 1080px) { .side { display: none; } .mstats { display: flex; } }
@media (max-width: 1000px) {
  .land { flex-direction: column; align-items: stretch; justify-content: center; padding: 12px 16px 40px; }
  .land-mark { flex: none; justify-content: flex-start; padding: 0; }
  .land-mark img { width: 48px; }
  .land-main { flex: none; padding: 0; }
  .land h1 { font-size: 40px; line-height: 48px; margin: 40px 0 32px; }
  .land h2 { font-size: 23px; line-height: 28px; margin-bottom: 24px; }
}
@media (max-width: 820px) {
  .app { flex-direction: column; }
  .nav { width: 100%; height: 53px; flex-direction: row; align-items: center; padding: 0 8px; z-index: 6; background: #000; border-bottom: 1px solid var(--line); }
  .nav-logo { width: 40px; height: 40px; margin: 0 4px 0 0; }
  .nav-logo img { width: 24px; height: 24px; }
  .nav .item { font-size: 15px; padding: 8px 10px; }
  .nav .item.hide-sm { display: none; }
  .nav .post { width: auto; margin: 0 0 0 auto; height: 32px; padding: 0 14px; font-size: 14px; }
  .col { width: 100%; border: 0; }
  .col-head { top: 53px; }
  .newpill { top: 170px; }
}
@media (max-width: 640px) {
  .stack, .fine, .ca { width: 100%; max-width: 380px; }
  .facts li { grid-template-columns: 1fr; gap: 2px; }
  .tl { border-left: 0; border-right: 0; }
}

/* clickable card -> thread on X */
.tw.go { cursor: pointer; }
.tw.go:hover { background: var(--row); }

/* media attached to posts: X-style grid */
.media { margin-top: 12px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: grid; gap: 2px; background: var(--line); max-height: 510px; }
.media:not(.n1) { aspect-ratio: 16 / 9; grid-template-columns: 1fr 1fr; }
.media.n3, .media.n4 { grid-template-rows: 1fr 1fr; }
.media.n3 .m:first-child { grid-row: span 2; }
.media .m { position: relative; display: block; min-height: 0; min-width: 0; background: #0b0b0b; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media .play { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(0, 0, 0, .65); border: 2px solid #fff; display: grid; place-items: center; }
.media .play svg { width: 28px; height: 28px; margin-left: 3px; }
.media .gif { position: absolute; left: 12px; bottom: 12px; padding: 0 4px; border-radius: 4px; background: rgba(0, 0, 0, .77); color: #fff; font-size: 13px; line-height: 16px; font-weight: 700; }

/* gork's drawing (black background, sits flush on the page) */
.land-mark img { max-width: 460px; }
.av.gork img { width: 100%; height: 100%; }
.nav-logo img { width: 40px; height: 40px; border-radius: 50%; }
@media (max-width: 1000px) { .land-mark img { width: 72px; margin-left: -10px; } }
@media (max-width: 820px) { .nav-logo img { width: 34px; height: 34px; } }
