:root {
  --page-bg: #f5f4ef;
  --page-bg-deep: #eceae2;
  --card: rgb(255 255 255 / 88%);
  --card-solid: #fff;
  --ink: #17202a;
  --ink-soft: #35404c;
  --muted: #707986;
  --border: #dedfd9;
  --border-strong: #cfd1ca;
  --accent: #5b5bd6;
  --accent-deep: #4141a8;
  --accent-soft: #ededff;
  --accent-wash: #f7f6ff;
  --warm: #ef8354;
  --green: #2f8f68;
  --shadow: 0 1px 2px rgb(24 32 42 / 4%), 0 12px 34px rgb(24 32 42 / 6%);
  --shadow-hover: 0 2px 4px rgb(24 32 42 / 5%), 0 18px 44px rgb(24 32 42 / 10%);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page-bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 4%, rgb(91 91 214 / 8%), transparent 26rem),
    radial-gradient(circle at 92% 18%, rgb(239 131 84 / 7%), transparent 24rem),
    linear-gradient(180deg, #faf9f6 0, var(--page-bg) 24rem, var(--page-bg-deep) 100%);
  font: 15px/1.55 "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input { font: inherit; }
.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 rgb(207 209 202 / 72%);
  background: rgb(250 249 246 / 82%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 65%);
  backdrop-filter: blur(18px) saturate(150%);
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(1180px, calc(100% - 36px));
  min-height: 68px;
  margin: 0 auto;
}
.wordmark {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -.04em;
}
.wordmark:hover { text-decoration: none; }
.wordmark__symbol {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: white;
  font: 600 21px/1 "DM Serif Display", Georgia, serif;
  border-radius: 11px;
  background: linear-gradient(145deg, #7474e6, var(--accent-deep));
  box-shadow: 0 7px 16px rgb(65 65 168 / 24%);
}
.brand-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.top-search {
  display: flex;
  flex: 0 1 380px;
  height: 38px;
  margin-left: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgb(255 255 255 / 72%);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.top-search:focus-within {
  border-color: rgb(91 91 214 / 55%);
  background: white;
  box-shadow: 0 0 0 4px rgb(91 91 214 / 9%);
}
.top-search input {
  width: 100%;
  min-width: 90px;
  padding: 7px 6px 7px 15px;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
}
.top-search input::placeholder { color: #9299a2; }
.top-search button {
  padding: 0 15px 0 10px;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.top-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; white-space: nowrap; }
.top-nav a {
  padding: 8px 12px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
  border-radius: 10px;
}
.top-nav a:hover { color: var(--accent-deep); text-decoration: none; background: var(--accent-soft); }

.messages { width: min(660px, calc(100% - 28px)); margin: 16px auto -6px; }
.message {
  padding: 11px 14px;
  color: #226147;
  border: 1px solid #badbcd;
  border-radius: 12px;
  background: #f0faf5;
  box-shadow: var(--shadow);
}
.page-shell { width: min(1180px, calc(100% - 36px)); margin: 30px auto 56px; }
.three-column-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 640px) 250px;
  gap: 24px;
  align-items: start;
  justify-content: center;
}

.profile-card, .side-box, .post-card, .composer-card, .empty-state, .feed-notice {
  border: 1px solid rgb(222 223 217 / 90%);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.profile-card { position: sticky; top: 98px; overflow: hidden; }
.profile-card__cover {
  position: relative;
  height: 92px;
  overflow: hidden;
  border-bottom: 1px solid rgb(255 255 255 / 34%);
  background:
    radial-gradient(circle at 78% 32%, rgb(255 255 255 / 30%) 0 3px, transparent 4px),
    radial-gradient(circle at 88% 64%, rgb(255 255 255 / 18%) 0 38px, transparent 39px),
    linear-gradient(135deg, #6667d9 0%, #8d70d1 48%, #e58a68 100%);
}
.profile-card__cover::after {
  position: absolute;
  right: -18px;
  bottom: -47px;
  width: 130px;
  height: 130px;
  content: "";
  border: 1px solid rgb(255 255 255 / 26%);
  border-radius: 36px;
  transform: rotate(28deg);
}
.profile-card__body { position: relative; padding: 50px 18px 19px; }
.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  color: white;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -.04em;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 14px;
  background: linear-gradient(145deg, #7778e7, var(--accent-deep));
  box-shadow: 0 7px 16px rgb(65 65 168 / 20%);
}
.avatar--large {
  position: absolute;
  top: -40px;
  left: 18px;
  width: 82px;
  height: 82px;
  font-size: 23px;
  border: 5px solid #fff;
  border-radius: 25px;
  box-shadow: 0 0 0 1px rgb(23 32 42 / 9%), 0 10px 22px rgb(23 32 42 / 15%);
}
.profile-card h1 { margin: 0 0 3px; font-size: 19px; line-height: 1.25; letter-spacing: -.03em; }
.profile-tagline { margin: 0 0 15px; color: var(--muted); font-size: 12px; }
.profile-meta {
  padding: 11px 0;
  color: var(--ink-soft);
  font-size: 12px;
  border-block: 1px solid #ecece7;
}
.profile-meta span { margin-right: 5px; color: var(--accent); }
.profile-bio { margin: 13px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }

.feed-column { min-width: 0; }
.composer-card { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 13px 14px; }
.composer-prompt {
  flex: 1;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
  border: 1px solid #e4e4df;
  border-radius: 12px;
  background: #f7f7f4;
}
.composer-prompt:hover { text-decoration: none; border-color: #d8d8d2; background: #f1f1ed; }
.composer-prompt--static:hover { background: #f7f7f4; }
.composer-button {
  padding: 9px 13px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  border-radius: 11px;
  background: var(--accent);
  box-shadow: 0 6px 15px rgb(91 91 214 / 20%);
}
.composer-button:hover { color: white; text-decoration: none; background: var(--accent-deep); }
.feed-notice { margin-bottom: 16px; padding: 11px 14px; color: var(--ink-soft); font-size: 13px; }

.post-card {
  position: relative;
  margin-bottom: 18px;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.post-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.post-card--featured { border-color: rgb(91 91 214 / 28%); }
.featured-label {
  padding: 8px 16px;
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
  border-bottom: 1px solid rgb(91 91 214 / 12%);
  background: linear-gradient(90deg, var(--accent-soft), #faf8ff);
}
.post-header { display: flex; gap: 11px; padding: 17px 18px 7px; }
.author-name { display: inline-block; margin-top: 1px; color: var(--ink); font-size: 13px; font-weight: 750; }
.author-name:hover { color: var(--accent-deep); }
.post-time { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--muted); font-size: 11px; }
.post-visibility { display: inline-flex; align-items: center; gap: 4px; }
.post-visibility::before { width: 4px; height: 4px; content: ""; border-radius: 50%; background: var(--green); }
.post-content { padding: 10px 18px 17px; }
.post-content h2 {
  margin: 0 0 9px;
  font: 400 30px/1.14 "DM Serif Display", Georgia, serif;
  letter-spacing: -.025em;
}
.post-content h2 a { color: var(--ink); }
.post-content h2 a:hover { color: var(--accent-deep); text-decoration-thickness: 1px; }
.post-content > p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.68; white-space: pre-line; }
.post-body { color: var(--ink-soft); font-size: 17px; line-height: 1.78; }
.post-body p { margin: 0 0 1.2em; }
.post-body p:last-child { margin-bottom: 0; }
.continue-link { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 700; }
.post-image { display: block; max-height: 520px; overflow: hidden; border-block: 1px solid #e8e8e3; background: #f2f1ec; }
.post-image img { display: block; width: 100%; max-height: 520px; object-fit: cover; transition: transform .4s ease; }
.post-image:hover img { transform: scale(1.012); }
.topics { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 18px 3px; }
.topics a {
  padding: 4px 9px;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 650;
  border: 1px solid rgb(91 91 214 / 12%);
  border-radius: 999px;
  background: var(--accent-wash);
}
.topics a:hover { text-decoration: none; background: var(--accent-soft); }
.engagement-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 9px 18px 0;
  padding: 10px 0;
  color: var(--muted);
  font-size: 11px;
  border-bottom: 1px solid #ecece7;
}
.engagement-summary strong { color: var(--ink-soft); font-weight: 650; }
.reaction-bubble {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  margin-right: 2px;
  color: white;
  font-size: 10px;
  border-radius: 7px;
  background: linear-gradient(145deg, #7676e5, var(--accent));
}
.post-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; padding: 7px 12px 12px; }
.reaction-form { display: contents; }
.post-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: color .18s ease, background .18s ease;
}
.post-action:hover { color: var(--ink); background: #f3f3ef; }
.post-action.is-active { color: var(--accent-deep); background: var(--accent-soft); }
.post-action:disabled { opacity: .6; cursor: wait; }
.share-button { width: 100%; }

.right-rail { position: sticky; top: 98px; display: grid; gap: 16px; }
.side-box { overflow: hidden; }
.side-box__header {
  padding: 15px 16px 3px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .02em;
}
.side-box__body { padding: 8px 16px 16px; color: var(--ink-soft); font-size: 12px; line-height: 1.62; }
.side-box__body p { margin: 0 0 10px; }
.side-box__body p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.compact-list { display: grid; gap: 12px; }
.compact-list > div { display: flex; align-items: center; }
.mini-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 25px;
  height: 25px;
  margin-right: 8px;
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 750;
  border-radius: 8px;
  background: var(--accent-soft);
}
.empty-state { padding: 64px 28px; text-align: center; }
.empty-state__icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: var(--accent-deep);
  font: 30px/1 "DM Serif Display", Georgia, serif;
  border-radius: 18px;
  background: var(--accent-soft);
}
.empty-state h2 { margin: 16px 0 5px; font: 400 25px/1.2 "DM Serif Display", Georgia, serif; }
.empty-state p { margin: 0; color: var(--muted); }
.back-link { display: inline-flex; margin: 2px 0 13px 3px; color: var(--muted); font-size: 12px; font-weight: 700; }
.back-link:hover { color: var(--accent-deep); }
.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  color: var(--muted);
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-solid);
  box-shadow: var(--shadow);
}
.pagination a { font-weight: 700; }
.pagination a:last-child { text-align: right; }
.site-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 24px 14px 34px;
  color: var(--muted);
  font-size: 11px;
  border-top: 1px solid rgb(207 209 202 / 65%);
  background: rgb(250 249 246 / 52%);
}

@media (max-width: 1040px) {
  .three-column-layout { grid-template-columns: 220px minmax(0, 640px); }
  .right-rail { display: none; }
  .brand-note { display: none; }
}

@media (max-width: 760px) {
  .topbar__inner { flex-wrap: wrap; gap: 9px; width: calc(100% - 24px); padding: 10px 0; }
  .wordmark { font-size: 18px; }
  .wordmark__symbol { width: 31px; height: 31px; border-radius: 10px; font-size: 19px; }
  .top-search { order: 3; flex-basis: 100%; height: 38px; margin-left: 0; }
  .top-nav a { padding: 7px 9px; }
  .page-shell { width: min(100% - 20px, 640px); margin-top: 14px; }
  .three-column-layout { display: block; }
  .profile-card { position: relative; top: auto; margin-bottom: 14px; }
  .profile-card__cover { height: 70px; }
  .profile-card__body { min-height: 96px; padding: 15px 15px 14px 112px; }
  .avatar--large { top: -44px; left: 15px; }
  .profile-bio, .profile-meta { display: none; }
  .composer-card { border-radius: 15px; }
  .composer-prompt--static { padding-inline: 10px; font-size: 12px; }
  .post-card { border-radius: 16px; }
  .post-card:hover { transform: none; }
  .post-content h2 { font-size: 27px; }
}

@media (max-width: 440px) {
  .topbar__inner, .messages { width: calc(100% - 20px); }
  .top-nav a:first-child { display: none; }
  .composer-card { align-items: flex-start; }
  .composer-button { display: none; }
  .post-header { padding-inline: 15px; }
  .post-content { padding-inline: 15px; }
  .post-content h2 { font-size: 25px; }
  .topics { padding-inline: 15px; }
  .engagement-summary { align-items: flex-start; margin-inline: 15px; }
  .post-actions { gap: 2px; padding-inline: 8px; }
  .post-action span { font-size: 11px; }
}

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