* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  --bg: #050505;
  --surface: #0b0b0b;
  --surface-2: #101010;
  --surface-3: #151515;
  --border: #242424;
  --border-soft: #1b1b1b;

  --text: #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-muted: #666;

  --radius: 14px;
  --pill: 999px;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;

  background:
    radial-gradient(
      circle at 50% -20%,
      #111 0,
      #050505 45%
    );

  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #777;
  outline-offset: 2px;
}

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

/* layout */

.app {
  width: min(1260px, 100%);
  min-height: 100vh;
  margin: auto;

  display: grid;
  grid-template-columns: 240px minmax(0, 640px) 320px;
}

.sidebar {
  height: 100vh;

  position: sticky;
  top: 0;

  padding: 18px 14px;

  display: flex;
  flex-direction: column;

  border-right: 1px solid var(--border-soft);
}

.brand {
  padding: 13px 14px 30px;

  font-size: 24px;
  font-weight: 800;
  letter-spacing: -1.2px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar nav button,
.logout {
  width: 100%;

  border: 0;
  border-radius: 12px;

  padding: 12px 14px;

  display: flex;
  align-items: center;
  gap: 14px;

  background: transparent;
  color: #d5d5d5;

  text-align: left;

  transition:
    background .15s ease,
    color .15s ease,
    transform .15s ease;
}

.sidebar nav button:hover,
.logout:hover {
  background: var(--surface-3);
  color: white;
}

.sidebar nav button:active,
.logout:active {
  transform: scale(.98);
}

.sidebar nav button .material-symbols-rounded,
.logout .material-symbols-rounded {
  font-size: 24px;
}

.sidebar-bottom {
  margin-top: auto;
}

.account-mini {
  width: 100%;

  border: 0;
  border-radius: 14px;

  padding: 10px;

  display: flex;
  align-items: center;
  gap: 10px;

  background: transparent;
  color: white;

  text-align: left;

  transition: background .15s ease;
}

.account-mini:hover {
  background: var(--surface-3);
}

.account-mini span {
  min-width: 0;
}

.account-mini b,
.account-mini small {
  display: block;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-mini small {
  margin-top: 2px;
  color: var(--text-muted);
}

/* main */

.main {
  min-height: 100vh;

  border-right: 1px solid var(--border-soft);
}

.topbar {
  height: 62px;

  padding: 0 20px;

  display: flex;
  align-items: center;

  position: sticky;
  top: 0;
  z-index: 20;

  background: rgba(5, 5, 5, .82);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  border-bottom: 1px solid var(--border-soft);
}

.topbar b {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -.2px;
}

.rightbar {
  padding: 18px;
}

/* images */

.avatar {
  width: 44px;
  height: 44px;

  flex: 0 0 44px;

  border-radius: 50%;

  object-fit: cover;

  background: #171717;

  user-select: none;
}

/* composer */

.composer {
  padding: 20px;

  border-bottom: 1px solid var(--border);
}

.composer-row {
  display: flex;
  gap: 13px;
}

.composer textarea {
  width: 100%;
  min-height: 78px;

  resize: vertical;

  border: 0;
  outline: 0;

  background: transparent;
  color: white;

  font-size: 17px;
  line-height: 1.5;

  padding: 8px 0;
}

.composer textarea::placeholder {
  color: #666;
}

.composer-tools {
  display: flex;
  align-items: center;

  gap: 4px;

  margin-left: 57px;
  margin-top: 6px;
}

.tool {
  border: 0;
  border-radius: 9px;

  padding: 8px 9px;

  display: flex;
  align-items: center;
  gap: 6px;

  background: transparent;
  color: #888;

  transition:
    background .15s ease,
    color .15s ease;
}

.tool:hover {
  background: #151515;
  color: white;
}

.tool .material-symbols-rounded {
  font-size: 21px;
}

.primary,
.secondary {
  border-radius: var(--pill);

  padding: 9px 18px;

  border: 0;

  font-weight: 700;

  transition:
    background .15s ease,
    transform .15s ease;
}

.primary {
  background: white;
  color: black;
}

.primary:hover {
  background: #dedede;
}

.primary:active,
.secondary:active {
  transform: scale(.97);
}

.secondary {
  background: #111;
  color: white;

  border: 1px solid #303030;
}

.secondary:hover {
  background: #191919;
}

.small {
  margin-left: auto;

  padding: 8px 18px;
}

.full {
  width: 100%;
}

.media-preview {
  margin: 8px 0 4px 57px;
}

/* upload preview only */

.media-preview img,
.media-preview video {
  display: block;
  width: auto;
  max-width: 500px;
  max-height: 350px;
  object-fit: contain;
  border-radius: 12px;
}

.attached {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 7px 10px;

  border: 1px solid #303030;
  border-radius: 10px;

  background: #0d0d0d;
  color: #aaa;
}

.attached button {
  width: 24px;
  height: 24px;

  border: 0;
  border-radius: 50%;

  display: grid;
  place-items: center;

  background: transparent;
  color: #888;
}

.attached button:hover {
  background: #222;
  color: white;
}

/* posts */

.post {
  padding: 19px 20px;

  border-bottom: 1px solid var(--border);

  transition: background .15s ease;
}

.post:hover {
  background: rgba(255, 255, 255, .012);
}

.post-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.post-author {
  min-width: 0;
}

.post-author b {
  display: block;

  font-size: 15px;
  font-weight: 700;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-author span,
.handle {
  color: #707070;
  font-size: 14px;
}

.post-text {
  margin: 12px 0 13px 55px;

  line-height: 1.55;
  font-size: 15.5px;

  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.post-media {
  display: block;

  width: calc(100% - 55px);
  max-width: 480px;
  max-height: 300px;

  margin: 12px 0 12px 55px;

  object-fit: contain;

  background: #101010;

  border: 1px solid #222;
  border-radius: 15px;
}

.post-audio {
  display: flex;
  align-items: center;
  gap: 10px;

  width: calc(100% - 55px);
  max-width: 480px;

  margin: 12px 0 12px 55px;
  padding: 10px;

  box-sizing: border-box;

  background: #101010;

  border: 1px solid #222;
  border-radius: 15px;
}

.post-audio audio {
  width: 100%;
}

.actions {
  width: calc(100% - 55px);

  margin-left: 55px;
  margin-top: 8px;

  display: flex;
  justify-content: space-between;
}

.actions button {
  min-width: 54px;

  border: 0;
  border-radius: 999px;

  padding: 7px 9px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;

  background: transparent;
  color: #666;

  transition:
    background .15s ease,
    color .15s ease;
}

.actions button:hover {
  background: #151515;
  color: #ddd;
}

.actions button.liked {
  color: #ff477e;
}

.actions button.liked:hover {
  background: rgba(255, 71, 126, .1);
}

/* comments */

.comments {
  width: calc(100% - 55px);

  margin-left: 55px;
  margin-top: 10px;

  border-top: 1px solid var(--border-soft);
}

.comment-compose {
  display: flex;
  align-items: center;
  gap: 9px;

  padding: 12px 0;
}

.comment-compose input {
  flex: 1;

  min-width: 0;

  border: 1px solid #2b2b2b;
  border-radius: 999px;

  background: #0a0a0a;
  color: white;

  padding: 9px 13px;

  outline: 0;

  transition: border-color .15s ease;
}

.comment-compose input:focus {
  border-color: #555;
}

.comment-compose button {
  width: 34px;
  height: 34px;

  border: 0;
  border-radius: 50%;

  display: grid;
  place-items: center;

  background: transparent;
  color: #888;
}

.comment-compose button:hover {
  background: #151515;
  color: white;
}

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

  border-radius: 50%;

  object-fit: cover;

  flex: 0 0 34px;
}

.comment {
  display: flex;
  gap: 9px;

  padding: 10px 0;
}

.comment-body {
  min-width: 0;
}

.comment-body span {
  color: #777;
  font-size: 14px;
}

.comment-body p {
  margin: 4px 0 0;

  color: #ddd;
  line-height: 1.45;

  overflow-wrap: anywhere;
}

.no-comments {
  color: #666;
  padding: 12px 0;
}

/* profiles */

.profile-page {
  border-bottom: 1px solid var(--border);
}

.profile-banner {
  height: 205px;

  background-color: #171717;
  background-size: cover;
  background-position: center;
}

.profile-info {
  position: relative;

  padding: 0 20px 22px;
}

.profile-avatar {
  width: 94px;
  height: 94px;

  border-radius: 50%;

  object-fit: cover;

  margin-top: -47px;

  border: 5px solid var(--bg);

  background: #171717;
}

.profile-button {
  float: right;

  margin-top: 15px;

  min-width: 105px;
}

.profile-info h1 {
  margin: 11px 0 2px;

  font-size: 24px;
  line-height: 1.2;

  letter-spacing: -.5px;
}

.bio {
  max-width: 550px;

  margin: 14px 0;

  color: #ddd;

  line-height: 1.5;

  white-space: pre-wrap;
}

.stats {
  display: flex;
  gap: 22px;

  margin-top: 15px;

  color: #777;
  font-size: 14px;
}

.stats b {
  margin-right: 4px;
  color: white;
}

.profile-tabs {
  padding: 16px 20px;

  border-bottom: 1px solid var(--border);

  font-size: 14px;
  font-weight: 700;
}

/* search */

.search-box {
  height: 44px;

  display: flex;
  align-items: center;
  gap: 9px;

  padding: 0 14px;

  border: 1px solid transparent;
  border-radius: 999px;

  background: #111;

  color: #777;

  transition:
    background .15s ease,
    border-color .15s ease;
}

.search-box:focus-within {
  background: #0d0d0d;
  border-color: #333;
}

.search-box .material-symbols-rounded {
  font-size: 21px;
}

.search-box input {
  width: 100%;

  border: 0;
  outline: 0;

  background: transparent;
  color: white;
}

.side-card {
  margin-top: 18px;

  padding: 18px;

  background: #0d0d0d;

  border: 1px solid var(--border);
  border-radius: 16px;
}

.side-card > b {
  font-size: 16px;
}

.mini-profile {
  display: flex;
  align-items: center;
  gap: 10px;

  margin: 16px 0;
}

.mini-profile > div {
  min-width: 0;
}

.mini-profile b,
.mini-profile span {
  display: block;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-profile span {
  margin-top: 2px;
  color: #777;
  font-size: 14px;
}

/* profile editor */

.modal {
  position: fixed;
  inset: 0;

  z-index: 100;

  display: grid;
  place-items: center;

  padding: 20px;

  background: rgba(0, 0, 0, .78);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-card {
  width: min(540px, 100%);
  max-height: 90vh;

  overflow: auto;

  background: #0d0d0d;

  border: 1px solid #292929;
  border-radius: 18px;

  padding: 20px;

  box-shadow: 0 25px 80px rgba(0, 0, 0, .55);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 18px;
}

.modal-header b {
  font-size: 16px;
}

.modal-header button {
  width: 34px;
  height: 34px;

  border: 0;
  border-radius: 50%;

  display: grid;
  place-items: center;

  background: transparent;
  color: #aaa;
}

.modal-header button:hover {
  background: #191919;
  color: white;
}

.banner-editor {
  position: relative;

  height: 170px;

  overflow: hidden;

  border-radius: 13px;

  background: #181818;

  border: 1px solid #222;
}

.banner-editor img {
  width: 100%;
  height: 100%;

  object-fit: cover;
}

.camera-button,
.avatar-camera {
  position: absolute;

  display: grid;
  place-items: center;

  border-radius: 50%;

  background: rgba(0, 0, 0, .72);

  border: 1px solid rgba(255, 255, 255, .12);

  cursor: pointer;

  transition:
    background .15s ease,
    transform .15s ease;
}

.camera-button {
  top: 50%;
  left: 50%;

  width: 42px;
  height: 42px;

  transform: translate(-50%, -50%);
}

.camera-button:hover {
  background: rgba(0, 0, 0, .9);
}

.avatar-editor {
  position: relative;

  width: 92px;
  height: 92px;

  margin-top: -46px;
  margin-left: 18px;
  margin-bottom: 20px;
}

.edit-avatar {
  width: 92px;
  height: 92px;

  border-radius: 50%;

  object-fit: cover;

  border: 4px solid #0d0d0d;
}

.avatar-camera {
  right: 0;
  bottom: 0;

  width: 32px;
  height: 32px;
}

.avatar-camera:hover {
  background: #111;
}

.field {
  display: block;

  margin: 15px 0;

  color: #999;

  font-size: 13px;
  font-weight: 600;
}

.field input,
.field textarea {
  display: block;

  width: 100%;

  margin-top: 7px;

  padding: 11px 12px;

  border: 1px solid #303030;
  border-radius: 11px;

  outline: 0;

  background: #080808;
  color: white;

  transition: border-color .15s ease;
}

.field input:focus,
.field textarea:focus {
  border-color: #555;
}

.field textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.45;
}

/* gifs */

.gif-modal {
  max-width: 700px;
}

.gif-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 7px;
}

.gif-choice {
  min-width: 0;

  padding: 0;

  border: 0;
  border-radius: 10px;

  background: #111;

  overflow: hidden;

  transition:
    transform .15s ease,
    outline .15s ease;
}

.gif-choice:hover {
  outline: 2px solid white;
  transform: scale(1.015);
}

.gif-choice img {
  display: block;

  width: 100%;
  height: 125px;

  object-fit: cover;
}

.gif-preview {
  position: relative;

  width: 190px;

  border-radius: 11px;
  overflow: hidden;
}

.gif-preview img {
  display: block;

  width: 190px;

  border-radius: 11px;
}

.gif-preview button {
  position: absolute;

  top: 6px;
  right: 6px;

  width: 28px;
  height: 28px;

  display: grid;
  place-items: center;

  border: 0;
  border-radius: 50%;

  background: rgba(0, 0, 0, .75);
  color: white;
}

/* search results */

.section-label {
  padding: 15px 20px;

  color: #777;

  border-bottom: 1px solid var(--border);

  font-size: 13px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: .04em;
}

.user-result {
  width: 100%;

  border: 0;
  border-bottom: 1px solid var(--border);

  background: transparent;
  color: white;

  padding: 13px 20px;

  display: flex;
  gap: 11px;
  align-items: center;

  text-align: left;

  transition: background .15s ease;
}

.user-result:hover {
  background: #0d0d0d;
}

.user-result > span {
  min-width: 0;
}

.user-result b,
.user-result small {
  display: block;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-result small {
  margin-top: 2px;
  color: #777;
}

/* notifications */

.notification {
  display: flex;
  gap: 12px;

  padding: 18px 20px;

  border-bottom: 1px solid var(--border);
}

.notification > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.notification span {
  color: #aaa;
}

/* auth */

.auth {
  min-height: 100vh;

  display: grid;
  place-items: center;

  padding: 20px;
}

.auth-card {
  width: min(400px, 100%);

  padding: 30px;

  background: #0d0d0d;

  border: 1px solid #242424;
  border-radius: 20px;

  box-shadow: 0 25px 70px rgba(0, 0, 0, .35);
}

.logo {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1px;

  margin-bottom: 32px;
}

.auth-card h1 {
  margin: 0 0 18px;

  font-size: 25px;
  letter-spacing: -.5px;
}

.auth-card input {
  width: 100%;

  padding: 12px 13px;

  margin: 5px 0;

  border: 1px solid #303030;
  border-radius: 11px;

  outline: 0;

  background: #080808;
  color: white;

  transition: border-color .15s ease;
}

.auth-card input:focus {
  border-color: #555;
}

.auth-card .primary,
.auth-card .secondary {
  margin-top: 8px;
}

.or {
  display: flex;
  align-items: center;
  gap: 10px;

  color: #555;

  text-align: center;

  margin: 15px 0;
}

.or::before,
.or::after {
  content: "";

  height: 1px;

  flex: 1;

  background: #222;
}

.error {
  margin-bottom: 0;

  color: #ff5b78;
  font-size: 14px;
}

.empty {
  padding: 70px 20px;

  color: #555;

  text-align: center;
}

/* mobile */

@media (max-width: 950px) {
  .app {
    grid-template-columns: 76px minmax(0, 640px);
    justify-content: center;
  }

  .rightbar {
    display: none;
  }

  .sidebar {
    padding: 18px 9px;
  }

  .brand {
    padding-left: 0;
    padding-right: 0;

    font-size: 0;

    text-align: center;
  }

  .brand::after {
    content: "✦";

    font-size: 25px;
  }

  .sidebar nav button {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .sidebar nav button span:not(.material-symbols-rounded),
  .sidebar .logout span:not(.material-symbols-rounded),
  .account-mini span {
    display: none;
  }

  .account-mini {
    justify-content: center;
  }

  .logout {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 650px) {
  .app {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main {
    border: 0;
  }

  .topbar {
    height: 56px;
    padding: 0 16px;
  }

  .composer {
    padding: 16px;
  }

  .composer-tools {
    margin-left: 0;
    margin-top: 8px;
  }

  .media-preview {
    margin-left: 0;
  }

  .post {
    padding: 16px;
  }

  .post-text,
  .post-media,
  .actions,
  .comments {
    margin-left: 0;
    width: 100%;
  }

  .post-audio {
    width: 100%;
    margin-left: 0;
  }

  .profile-banner {
    height: 150px;
  }

  .profile-info {
    padding-left: 16px;
    padding-right: 16px;
  }

  .profile-avatar {
    width: 86px;
    height: 86px;

    margin-top: -43px;
  }

  .gif-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gif-choice img {
    height: 110px;
  }

  .modal {
    padding: 10px;
  }

  .modal-card {
    border-radius: 16px;
    padding: 16px;
  }
}
