:root {
  color-scheme: light;
  --font-body: "Plus Jakarta Sans", sans-serif;
  --bg: #f0f2f5;
  --bg-accent: #dfe8ff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --surface-alt: #eef3ff;
  --text: #18212f;
  --muted: #5b6678;
  --line: rgba(24, 33, 47, 0.09);
  --brand: #1877f2;
  --brand-strong: #1664d9;
  --success: #31a24c;
  --danger: #d95151;
  --shadow: 0 28px 80px rgba(24, 33, 47, 0.12);
  --ambient-a: rgba(24, 119, 242, 0.12);
  --ambient-b: rgba(49, 162, 76, 0.1);
}

body.theme-midnight {
  color-scheme: dark;
  --bg: #0f1725;
  --bg-accent: #192338;
  --surface: rgba(20, 30, 46, 0.88);
  --surface-strong: #172233;
  --surface-alt: #1d2a40;
  --text: #f2f6ff;
  --muted: #9baccc;
  --line: rgba(255, 255, 255, 0.08);
  --brand: #4d9cff;
  --brand-strong: #7bb3ff;
  --success: #59c36f;
  --danger: #ff8a8a;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  --ambient-a: rgba(77, 156, 255, 0.18);
  --ambient-b: rgba(89, 195, 111, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, var(--ambient-a), transparent 30%),
    radial-gradient(circle at bottom right, var(--ambient-b), transparent 32%),
    linear-gradient(180deg, var(--bg-accent), var(--bg));
  color: var(--text);
  transition: background 180ms ease, color 180ms ease;
}

button,
input,
textarea,
a {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.landing-shell {
  padding: 32px 28px 88px;
}

.feed-shell {
  padding: 20px 20px 88px;
}

.ambient {
  position: absolute;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.65;
  pointer-events: none;
}

.ambient-left {
  top: -9rem;
  left: -10rem;
  background: var(--ambient-a);
}

.ambient-right {
  right: -12rem;
  bottom: -10rem;
  background: var(--ambient-b);
}

.topbar,
.feed-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.feed-topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 18px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--brand), var(--brand-strong));
  color: #fff;
  font-size: 1.65rem;
  font-weight: 800;
  box-shadow: 0 18px 40px rgba(24, 119, 242, 0.24);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  font-size: 1.2rem;
}

.top-actions,
.feed-actions,
.auth-mode-switch,
.composer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feed-actions {
  justify-content: flex-end;
}

.ghost-button,
.primary-button,
.submit-button,
.mode-chip,
.text-button {
  border-radius: 14px;
  transition:
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.ghost-button,
.text-button,
.mode-chip,
.profile-chip {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

.ghost-button,
.primary-button,
.submit-button {
  padding: 0.92rem 1.3rem;
  font-weight: 700;
}

.primary-button,
.submit-button {
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  color: #fff;
  box-shadow: 0 16px 34px rgba(24, 119, 242, 0.22);
}

.text-button,
.mode-chip {
  padding: 0.75rem 1rem;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.4rem 0.75rem 0.4rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
}

.landing-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: center;
  max-width: 1280px;
  margin: 48px auto 0;
}

.hero-panel {
  padding-right: 20px;
}

.status-pill,
.proof-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--brand);
  font-weight: 700;
}

.hero-panel h2 {
  max-width: 12ch;
  margin-top: 18px;
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.hero-copy {
  max-width: 58ch;
  margin-top: 22px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.feature-card,
.social-proof-card,
.auth-card,
.sidebar-card,
.composer-card,
.wall-card,
.stories-card,
.post-card,
.profile-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.feature-card {
  padding: 18px;
  border-radius: 24px;
}

.feature-card p,
.proof-post p,
.mini-panel p,
.sidebar-card p,
.post-card p,
.story-card p,
.composer-note,
.section-note {
  color: var(--muted);
  line-height: 1.6;
}

.social-proof-card {
  margin-top: 24px;
  padding: 20px;
  border-radius: 28px;
}

.proof-header,
.proof-post,
.helper-row,
.field,
.section-heading,
.profile-summary,
.composer-header,
.post-header {
  display: flex;
  align-items: center;
}

.proof-header,
.helper-row,
.section-heading {
  justify-content: space-between;
}

.proof-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(49, 162, 76, 0.15);
}

.proof-post {
  gap: 16px;
  margin-top: 18px;
}

.avatar-stack {
  display: flex;
  margin-right: 8px;
}

.avatar-stack span,
.avatar,
.story-avatar {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), var(--brand-strong));
}

.avatar-image {
  object-fit: cover;
}

.avatar-stack span {
  width: 42px;
  height: 42px;
  margin-left: -10px;
  border: 3px solid var(--surface-strong);
  border-radius: 999px;
}

.avatar-stack span:first-child {
  margin-left: 0;
}

.auth-panel {
  display: flex;
  justify-content: center;
}

.auth-card {
  width: min(100%, 470px);
  padding: 24px;
  border-radius: 32px;
}

.auth-heading {
  margin-top: 18px;
}

.auth-heading h2 {
  font-size: 2rem;
  line-height: 1.05;
}

.auth-heading p:last-child {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.field {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.field span {
  font-weight: 700;
}

.field input,
.feed-search input,
.wall-form textarea {
  width: 100%;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
}

.wall-form textarea {
  min-height: 120px;
  resize: vertical;
  border-radius: 18px;
  background: var(--surface-alt);
}

.field input:focus,
.feed-search input:focus,
.wall-form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(24, 119, 242, 0.15);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.auth-feedback {
  min-height: 28px;
  margin-top: 16px;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: var(--surface-alt);
  color: var(--muted);
}

.auth-feedback.success {
  color: var(--success);
}

.auth-feedback.error {
  color: var(--danger);
}

.mini-panels {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.mini-panel {
  padding: 16px;
  border-radius: 20px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

.theme-switcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.95rem 1.1rem;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.theme-icon {
  font-size: 1rem;
}

.feed-search {
  flex: 1;
  max-width: 420px;
}

.feed-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  max-width: 1180px;
  margin: 24px auto 0;
}

.sidebar-stack {
  display: grid;
  gap: 18px;
  align-self: start;
  position: sticky;
  top: 20px;
}

.sidebar-card,
.composer-card,
.wall-card,
.stories-card,
.post-card {
  border-radius: 24px;
  padding: 18px;
}

.sidebar-card {
  position: static;
}

.sidebar-list {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.9;
}

.info-list,
.member-card-list,
.event-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.sidebar-link {
  display: block;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  font-weight: 700;
}

.sidebar-link.active,
.sidebar-link:hover {
  background: var(--surface);
  border-color: rgba(24, 119, 242, 0.28);
}

.page-list {
  margin-top: 18px;
}

.page-form {
  max-width: 420px;
}

.info-list.compact {
  gap: 10px;
}

.info-item,
.member-card,
.event-item {
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

.member-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-card.active {
  border-color: var(--brand);
}

.member-avatar {
  width: 52px;
  height: 52px;
}

.member-card-body {
  display: grid;
  gap: 2px;
}

.event-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.event-form input,
.comment-form input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.feed-column,
.post-list,
.profile-layout {
  display: grid;
  gap: 18px;
}

.stories-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(170px, 1fr);
  gap: 14px;
  margin-top: 18px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.story-card {
  min-height: 180px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(24, 119, 242, 0.2), rgba(24, 119, 242, 0.03)),
    var(--surface-alt);
}

.create-story {
  background:
    linear-gradient(180deg, rgba(49, 162, 76, 0.24), rgba(49, 162, 76, 0.04)),
    var(--surface-alt);
}

.story-avatar {
  width: 52px;
  height: 52px;
  margin-bottom: 48px;
  border-radius: 16px;
}

.avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.avatar.large {
  width: 58px;
  height: 58px;
}

.profile-avatar {
  width: 38px;
  height: 38px;
}

.profile-page-avatar {
  width: 108px;
  height: 108px;
  border-radius: 999px;
  border: 5px solid var(--surface-strong);
  font-size: 2rem;
}

.composer-header,
.post-header {
  gap: 14px;
}

.post-header {
  align-items: flex-start;
}

.post-meta {
  flex: 1;
}

.wall-form {
  margin-top: 18px;
}

.attachment-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.attachment-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  cursor: pointer;
  font-weight: 700;
}

.attachment-icon {
  font-size: 1rem;
}

.attachment-name {
  color: var(--muted);
  font-size: 0.95rem;
}

.attachment-preview {
  margin-top: 12px;
}

.attachment-preview-image,
.post-image-content {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--line);
}

.composer-actions.simple {
  justify-content: space-between;
  margin-top: 12px;
}

.post-list {
  margin-top: 18px;
}

.post-body {
  margin-top: 16px;
  white-space: pre-wrap;
}

.post-image-wrap {
  margin-top: 16px;
}

.post-social-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.action-button,
.menu-trigger,
.reaction-option,
.menu-panel button {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--text);
}

.action-button,
.menu-trigger,
.menu-panel button {
  padding: 0.7rem 0.95rem;
  font-weight: 700;
}

.reaction-picker {
  position: relative;
}

.reaction-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  display: flex;
  gap: 8px;
  padding: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.reaction-picker:hover .reaction-popover,
.reaction-picker:focus-within .reaction-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.reaction-option {
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
}

.reaction-option.active,
.reaction-option:hover,
.action-button:hover,
.menu-trigger:hover,
.menu-panel button:hover {
  background: var(--surface);
}

.comments-section {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.comment-list {
  display: grid;
  gap: 10px;
}

.comment-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.comment-avatar {
  width: 34px;
  height: 34px;
}

.comment-bubble {
  flex: 1;
  padding: 0.8rem 0.95rem;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.comment-bubble p {
  margin-top: 4px;
}

.comment-delete {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
}

.comment-empty {
  color: var(--muted);
  font-size: 0.95rem;
}

.comment-form {
  display: flex;
  gap: 10px;
}

.comment-form input {
  flex: 1;
}

.ghost-button.compact {
  padding: 0.75rem 1rem;
}

.post-menu {
  position: relative;
}

.menu-trigger {
  min-width: 44px;
}

.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 150px;
  padding: 8px;
  border-radius: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.post-menu:hover .menu-panel,
.post-menu:focus-within .menu-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.menu-panel button {
  width: 100%;
  text-align: left;
}

.shared-post-shell {
  margin-top: 16px;
  padding: 14px;
  border-radius: 20px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

.shared-label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.shared-post-card {
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.shared-image {
  margin-top: 12px;
}

.post-header.compact {
  align-items: center;
}

.empty-state {
  padding: 22px;
  border-radius: 20px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
  background: var(--surface-alt);
}

.profile-layout {
  max-width: 980px;
  margin: 24px auto 0;
}

.profile-hero {
  overflow: hidden;
  border-radius: 30px;
}

.profile-banner {
  min-height: 220px;
  background:
    linear-gradient(135deg, rgba(24, 119, 242, 0.95), rgba(17, 34, 58, 0.82)),
    linear-gradient(180deg, rgba(49, 162, 76, 0.25), transparent);
}

.profile-summary {
  align-items: flex-end;
  gap: 18px;
  padding: 0 24px 24px;
  margin-top: -54px;
}

.profile-avatar-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profile-avatar-hover {
  position: absolute;
  inset: auto 0 10px 0;
  margin: 0 auto;
  width: fit-content;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(15, 23, 37, 0.8);
  color: #fff;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 140ms ease;
}

.profile-avatar-upload:hover .profile-avatar-hover,
.profile-avatar-upload:focus-within .profile-avatar-hover {
  opacity: 1;
}

.ghost-button:hover,
.text-button:hover,
.mode-chip.active,
.profile-chip:hover {
  background: var(--surface-alt);
}

.primary-button:hover,
.submit-button:hover,
.theme-switcher:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.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;
}

@media (max-width: 1120px) {
  .landing-grid,
  .feed-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    padding-right: 0;
  }

  .hero-feature-grid {
    grid-template-columns: 1fr;
  }

  .sidebar-card {
    position: static;
  }

  .sidebar-stack {
    position: static;
    top: auto;
  }
}

@media (max-width: 720px) {
  .landing-shell,
  .feed-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar,
  .feed-topbar,
  .helper-row,
  .composer-actions,
  .feed-actions,
  .section-heading,
  .profile-summary,
  .attachment-row,
  .post-actions,
  .comment-form,
  .member-card {
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions,
  .auth-mode-switch {
    width: 100%;
  }

  .top-actions > *,
  .auth-mode-switch > *,
  .feed-actions > * {
    flex: 1;
    text-align: center;
  }

  .profile-chip {
    justify-content: center;
  }

  .hero-panel h2 {
    max-width: none;
  }

  .stories-row {
    grid-auto-columns: minmax(220px, 1fr);
  }

  .theme-switcher {
    right: 16px;
    bottom: 16px;
  }
}
