:root {
  --page-bg: #fff;
  --surface: #fff;
  --surface-subtle: #f7f8fa;
  --ink: #111827;
  --ink-soft: #3f4753;
  --muted: #68717e;
  --border: #dfe3e8;
  --border-strong: #c9cfd7;
  --navy: #071a4f;
  --navy-hover: #0d286e;
  --navy-wash: #f1f4fb;
  --success: #266b4d;
  --danger: #9b3030;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; color-scheme: light; background: var(--page-bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page-bg);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button, input, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(14px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 26px;
  width: min(1380px, calc(100% - 80px));
  min-height: 88px;
  margin: 0 auto;
}

.wordmark {
  flex: 0 0 auto;
  color: #0d1117;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.055em;
}

.wordmark:hover { text-decoration: none; }
.brand-note {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.top-search {
  display: flex;
  flex: 0 1 410px;
  align-items: center;
  height: 46px;
  margin-left: clamp(8px, 4vw, 68px);
  padding: 0 13px;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  background: var(--surface);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.top-search:focus-within {
  border-color: #8f99aa;
  box-shadow: 0 0 0 3px rgb(7 26 79 / 7%);
}

.top-search > i { font-size: 19px; }
.top-search input {
  width: 100%;
  min-width: 100px;
  padding: 8px 12px;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
}

.top-search input::placeholder { color: #7e8794; }
.top-search kbd { color: #6e7784; font: 500 11px/1 var(--sans); white-space: nowrap; }
.top-nav {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  white-space: nowrap;
}

.top-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  color: #202631;
  font-size: 13px;
  font-weight: 600;
}

.top-nav a:hover { color: var(--navy); text-decoration: none; }
.top-nav a.is-active::after {
  position: absolute;
  right: 0;
  bottom: 19px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--navy);
}

.account-summary {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.account-summary__text { display: grid; gap: 1px; }
.account-summary__text strong { color: var(--ink); font-size: 12px; line-height: 1.3; }
.nav-logout { margin: 0; line-height: 1; }
.nav-logout button { padding: 0; color: var(--muted); font-size: 11px; border: 0; background: transparent; cursor: pointer; }
.nav-logout button:hover { color: var(--navy); text-decoration: underline; }
.sign-in-link { color: var(--ink-soft); font-size: 13px; font-weight: 600; white-space: nowrap; }

.messages { width: min(780px, calc(100% - 40px)); margin: 18px auto -18px; }
.message { padding: 11px 14px; color: var(--success); font-size: 13px; border: 1px solid #bdd8cb; border-radius: 4px; background: #f5fbf8; }

.page-shell { width: min(1180px, calc(100% - 64px)); margin: 55px auto 48px; }
.editorial-layout {
  display: grid;
  grid-template-columns: minmax(0, 790px) minmax(240px, 1fr);
  gap: 48px;
  align-items: start;
}
.editorial-main { min-width: 0; }

.profile-intro {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 0 22px;
  padding-bottom: 0;
}

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  color: white;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.035em;
  border-radius: 50%;
  background: var(--navy);
}

.avatar--large { width: 68px; height: 68px; font: 600 22px/1 var(--sans); }
.avatar--account { width: 38px; height: 38px; font-size: 11px; }
.profile-intro__copy { min-width: 0; }
.profile-intro h1 { margin: 2px 0 2px; font: 600 28px/1.2 var(--serif); letter-spacing: -.025em; }
.profile-tagline { margin: 0; color: var(--ink-soft); font-size: 14px; }
.profile-meta { display: flex; align-items: center; gap: 7px; margin-top: 13px; color: var(--muted); font-size: 13px; }
.profile-meta i { font-size: 17px; }
.profile-rule { grid-column: 1 / -1; margin-top: 32px; border-top: 1px solid var(--border); }
.profile-bio { grid-column: 1 / -1; margin: 16px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }

.feed-column { min-width: 0; }
.composer-card { margin: 38px 0 40px; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface); }
.composer-card--active { scroll-margin-top: 108px; }
.composer-fields { min-width: 0; }
.composer-fields > textarea { display: block; width: 100%; min-height: 118px; padding: 18px 19px; resize: vertical; color: var(--ink); font: 400 18px/1.55 var(--serif); border: 0; outline: 0; background: transparent; }
.composer-fields > textarea::placeholder { color: var(--muted); opacity: 1; }
.composer-fields > textarea:focus { box-shadow: inset 0 0 0 2px rgb(7 26 79 / 10%); }
.composer-footer { display: flex; align-items: center; justify-content: flex-end; gap: 15px; min-height: 54px; padding: 8px 13px; border-top: 1px solid var(--border); }
.composer-count { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.composer-count.is-near-limit { color: #9a5326; font-weight: 700; }
.composer-button { min-width: 88px; height: 38px; padding: 0 18px; color: white; font-size: 13px; font-weight: 700; border: 1px solid var(--navy); border-radius: 4px; background: var(--navy); cursor: pointer; }
.composer-button:hover { background: var(--navy-hover); }
.composer-button:disabled { opacity: .78; cursor: not-allowed; }
.composer-errors { display: grid; gap: 3px; padding: 10px 14px; color: var(--danger); font-size: 12px; border-top: 1px solid #e4bcbc; background: #fff8f8; }

.feed-notice { margin: 0 0 28px; padding: 12px 14px; color: var(--ink-soft); font-size: 13px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-subtle); }
.date-divider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; margin: 36px 0 26px; color: var(--muted); font: 400 14px/1.3 var(--serif); }
.date-divider::before, .date-divider::after { height: 1px; content: ""; background: var(--border); }

.post-card { position: relative; padding-bottom: 0; border-bottom: 1px solid var(--border); scroll-margin-top: 110px; }
.post-card + .post-card { padding-top: 26px; }
.featured-label { display: flex; align-items: center; gap: 6px; margin-bottom: 15px; color: var(--navy); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.post-header { display: flex; align-items: center; gap: 11px; }
.post-header .avatar { width: 42px; height: 42px; }
.author-name { display: inline-block; color: var(--ink); font-size: 12px; font-weight: 700; }
.author-name:hover { color: var(--navy); }
.post-time { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 1px; color: var(--muted); font-size: 11px; }
.post-time a { color: inherit; }
.post-time a:hover { color: var(--navy); }
.post-visibility { display: inline-flex; align-items: center; gap: 4px; }
.post-visibility::before { content: "·"; margin-right: 2px; }
.post-visibility i { font-size: 13px; }

.post-content { padding: 25px 0 20px; }
.post-content h2 { max-width: 690px; margin: 0 0 12px; font: 500 clamp(29px, 2.7vw, 38px)/1.16 var(--serif); letter-spacing: -.032em; }
.post-content h2 a { color: var(--ink); }
.post-content h2 a:hover { color: var(--navy); text-decoration-thickness: 1px; }
.post-content > p { max-width: 700px; margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.72; white-space: pre-line; }
.post-body { max-width: 700px; color: var(--ink-soft); font: 400 18px/1.82 var(--serif); }
.post-body p { margin: 0 0 1.2em; }
.post-body p:last-child { margin-bottom: 0; }
.status-update-body { max-width: 715px; color: #121722; font: 400 clamp(24px, 2.15vw, 31px)/1.36 var(--serif); letter-spacing: -.018em; }
.status-update-body p { margin: 0 0 .8em; }
.status-update-body p:last-child { margin-bottom: 0; }
.post-card--update .post-content { padding-top: 25px; padding-bottom: 24px; }
.continue-link { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 700; }
.post-image { display: block; max-height: 520px; margin: 4px 0 20px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-subtle); }
.post-image img { display: block; width: 100%; max-height: 520px; object-fit: cover; }
.topics { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; }
.topics a { color: var(--muted); font-size: 11px; font-weight: 600; }
.topics a:hover { color: var(--navy); }

.engagement-summary { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0 14px; color: var(--muted); font-size: 11px; }
.engagement-summary > span { display: inline-flex; align-items: center; gap: 4px; }
.engagement-summary i { font-size: 17px; }
.engagement-summary strong { color: var(--ink-soft); font-weight: 600; }
.post-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--border); }
.reaction-form { display: contents; }
.post-action { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 58px; padding: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 600; border: 0; border-radius: 0; background: transparent; cursor: pointer; transition: color .15s ease, background .15s ease; }
.post-action i { font-size: 19px; }
.post-action:hover { color: var(--navy); background: var(--navy-wash); }
.post-action.is-active { color: var(--navy); background: var(--navy-wash); }
.post-action:disabled { opacity: .55; cursor: wait; }
.share-button { width: 100%; }

.right-rail { position: sticky; top: 116px; display: grid; gap: 36px; min-height: 600px; padding-left: 46px; border-left: 1px solid var(--border); }
.side-box + .side-box { padding-top: 35px; border-top: 1px solid var(--border); }
.side-box__header { margin: 0 0 17px; color: var(--ink); font: 600 20px/1.25 var(--serif); letter-spacing: -.015em; }
.side-box__body { color: var(--ink-soft); font-size: 13px; line-height: 1.75; }
.side-box__body p { margin: 0 0 20px; }
.side-box__body p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.muted strong { color: var(--ink-soft); }
.compact-list { display: grid; gap: 22px; }
.compact-list > div { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: 12px; }
.compact-list i { color: var(--ink-soft); font-size: 21px; }

.empty-state { padding: 60px 20px; text-align: center; border-block: 1px solid var(--border); }
.empty-state__icon { display: none; }
.empty-state h2 { margin: 0 0 6px; font: 500 27px/1.2 var(--serif); }
.empty-state p { margin: 0; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 7px; margin: 36px 0 24px; color: var(--muted); font-size: 12px; font-weight: 600; }
.back-link:hover { color: var(--navy); }

.auth-shell { display: grid; place-items: center; min-height: min(620px, calc(100vh - 190px)); }
.auth-card { width: min(430px, 100%); padding: 36px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); }
.avatar--auth { width: 52px; height: 52px; margin-bottom: 20px; font-size: 15px; }
.auth-eyebrow { margin: 0 0 6px; color: var(--navy); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.auth-card h1 { margin: 0; font: 500 34px/1.18 var(--serif); letter-spacing: -.025em; }
.auth-intro { margin: 10px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.auth-form { display: grid; gap: 16px; }
.auth-field { display: grid; gap: 6px; }
.auth-field label { color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.auth-field input { width: 100%; padding: 11px 12px; color: var(--ink); border: 1px solid var(--border-strong); border-radius: 4px; outline: 0; background: white; }
.auth-field input:focus { border-color: #8f99aa; box-shadow: 0 0 0 3px rgb(7 26 79 / 7%); }
.auth-errors, .field-error { color: var(--danger); font-size: 12px; }
.auth-errors { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid #e3bcbc; border-radius: 4px; background: #fff7f7; }
.auth-submit { padding: 11px 15px; color: white; font-weight: 700; border: 1px solid var(--navy); border-radius: 4px; background: var(--navy); cursor: pointer; }
.auth-submit:hover { background: var(--navy-hover); }
.auth-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; color: var(--muted); font-size: 12px; font-weight: 600; }

.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 28px; padding: 14px 0; color: var(--muted); font-size: 12px; border-block: 1px solid var(--border); }
.pagination a { font-weight: 600; }
.pagination a:last-child { text-align: right; }
.site-footer { display: flex; justify-content: center; gap: 9px; padding: 33px 14px 40px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--border); background: white; }
.site-footer a { color: inherit; }

@media (max-width: 1080px) {
  .topbar__inner { width: calc(100% - 40px); }
  .brand-note { display: none; }
  .top-search { margin-left: 12px; }
  .page-shell { width: min(790px, calc(100% - 40px)); }
  .editorial-layout { display: block; }
  .right-rail { display: none; }
}

@media (max-width: 760px) {
  .topbar__inner { flex-wrap: wrap; gap: 10px 18px; width: calc(100% - 28px); min-height: 0; padding: 14px 0; }
  .wordmark { font-size: 24px; }
  .top-search { order: 3; flex-basis: 100%; height: 42px; margin: 0; }
  .top-nav { gap: 15px; margin-left: auto; }
  .top-nav a { height: 38px; }
  .top-nav a.is-active::after { bottom: 0; }
  .top-nav a:first-child, .top-nav .desktop-nav { display: none; }
  .account-summary { padding-left: 0; border: 0; }
  .account-summary__text { display: none; }
  .avatar--account { width: 35px; height: 35px; }
  .page-shell { width: calc(100% - 28px); margin-top: 28px; }
  .profile-intro { grid-template-columns: 58px minmax(0, 1fr); gap-x: 16px; }
  .avatar--large { width: 58px; height: 58px; font-size: 19px; }
  .profile-intro h1 { margin-top: 0; font-size: 25px; }
  .profile-tagline { font-size: 13px; }
  .profile-meta { margin-top: 10px; }
  .profile-rule { margin-top: 25px; }
  .composer-card { margin-block: 30px 34px; }
  .status-update-body { font-size: 25px; }
  .post-content h2 { font-size: 31px; }
  .auth-shell { min-height: 0; padding: 30px 0 48px; }
}

@media (max-width: 480px) {
  .top-nav a { font-size: 12px; }
  .top-nav a[href$="#quick-post"] { display: none; }
  .profile-bio { font-size: 13px; }
  .date-divider { gap: 12px; }
  .post-time { max-width: 250px; }
  .status-update-body { font-size: 22px; }
  .post-content h2 { font-size: 28px; }
  .engagement-summary { align-items: flex-start; }
  .post-action { min-height: 52px; }
  .post-action span { font-size: 11px; }
  .auth-card { padding: 27px 21px; }
  .auth-card h1 { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
