@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
  color-scheme: dark;
  --black: #f4f1f8;
  --gray: #aaa3b5;
  --gray-light: #332d3e;
  --red: #ef5350;
  --background: #0c0a10;
  --surface: #18141f;
  --surface-raised: #211a2b;
  --accent: #b89cff;
  --border-color: rgba(216, 198, 255, 0.16);
  --font-size-base: 1rem;
  --font-size-md: clamp(1.25rem, 0.61 + 1.1rem, 1.58rem);
  --font-size-lg: clamp(1.56rem, 1vw + 1.31rem, 2.11rem);
  --font-size-xl: clamp(2.44rem, 2.38vw + 1.85rem, 3.75rem);
  --border-radius: 10px;
}

body {
  font-family: 'Popins', sans-serif;
  color: var(--black);
  font-size: var(--font-size-base);
  background-color: var(--background);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(128, 86, 190, 0.2), transparent 32rem),
    radial-gradient(circle at 90% 35%, rgba(62, 92, 154, 0.12), transparent 30rem),
    linear-gradient(180deg, #0c0a10 0%, #110d17 100%);
  background-attachment: fixed;
  margin: 0;
}

a {
  color: var(--black);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

input::placeholder,
textarea::placeholder {
  color: var(--gray);
}

h1 {
  font-size: var(--font-size-xl);
}

h2 {
  font-size: var(--font-size-lg);
}

h3 {
  font-size: var(--font-size-md);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  font-family: 'Popins', sans-serif;
  font-size: var(--font-size-base);
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 0.7rem 0.75rem;
  margin-bottom: 1rem;
  color: var(--black);
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.btn {
  background-color: var(--accent);
  border: none;
  color: var(--background);
  padding: 16px 32px;
  text-decoration: none;
  margin: 4px 2px;
  cursor: pointer;
}

.btn-delete {
  padding: 10px 16px;
  background-color: var(--red);
}

img {
  width: 100%;
  height: auto;
}

/* Layout */
.container {
  max-width: 982px;
  margin: 0 auto;
  padding: 0 10px;
}

.main {
  padding: 90px 0 20px;
}

.header {
  position: absolute;
  z-index: 40;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  display: grid;
  width: min(calc(100% - 20px), 982px);
  gap: 0 10px;
  align-items: center;
  box-sizing: border-box;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto;
  padding: 8px 10px;
  background: rgba(18, 14, 24, 0.84);
  border: 1px solid var(--border-color);
  border-radius: calc(var(--border-radius) + 6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  grid-template-areas:
    "logo button"
    "menu menu"
  ;
}

@media only screen and (min-width: 1025px) {
  .header {
    top: 10px;
    gap: 0;
    grid-template-columns: auto 1fr auto;
    padding: 10px 14px;
    grid-template-areas:
      "logo menu button";
  }

}

.header__logo {
  overflow: hidden;
  min-width: 0;
  max-width: min(62vw, 320px);
  grid-area: logo;
  color: var(--accent);
  font-weight: 800;
  font-size: clamp(0.95rem, 2.6vw, 1.15rem);
  text-overflow: ellipsis;
  text-decoration: none;
  white-space: nowrap;
}

.header__logo:hover {
  text-decoration: underline;
}

.header__nav {
  grid-area: menu;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  justify-content: center;
}

.header__button {
  position: relative;
  grid-area: button;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: end;
}

.header-account {
  position: relative;
  display: flex;
  min-width: 92px;
  align-items: center;
  justify-content: flex-end;
}

html.js .header-account.is-session-pending > * {
  visibility: hidden;
}

.mobile-nav-account {
  display: none;
}

.header__button button {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  border: 0;
  padding: 6px 12px;
  background: none;
  border-radius: var(--border-radius);
  border: 2px solid transparent;
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--black);
}

.header__button button:hover {
  color: var(--accent);
  border: 2px solid var(--accent);
}

.header .loginBtn {
  display: inline-flex;
  min-height: 40px;
  box-sizing: border-box;
  gap: 7px;
  align-items: center;
  padding: 8px 12px;
  color: var(--black);
  background-color: rgba(184, 156, 255, 0.1);
  border: 1px solid rgba(184, 156, 255, 0.26);
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.header__button .mobile-nav-toggle {
  display: grid;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  gap: 4px;
  justify-content: center;
  padding: 0;
  background-color: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-color);
  place-content: center;
}

.header__button .mobile-nav-toggle:hover,
.header__button .mobile-nav-toggle[aria-expanded="true"] {
  color: var(--accent);
  background-color: rgba(184, 156, 255, 0.1);
  border: 1px solid rgba(184, 156, 255, 0.4);
}

.mobile-nav-toggle span {
  display: block;
  width: 17px;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.header.is-nav-open .mobile-nav-toggle span:first-child {
  transform: translateY(6px) rotate(45deg);
}

.header.is-nav-open .mobile-nav-toggle span:nth-child(2) {
  opacity: 0;
}

.header.is-nav-open .mobile-nav-toggle span:last-child {
  transform: translateY(-6px) rotate(-45deg);
}

@media only screen and (max-width: 1024px) {
  html.js .header .header__nav {
    display: none;
  }

  html.js .header.is-nav-open .header__nav {
    display: flex;
    margin-top: 12px;
  }

  .mobile-nav-account {
    display: block;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
  }

  .mobile-nav-account .header-account {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    width: 100%;
  }

  html.js .header__button > .header-account {
    display: none;
  }

  .mobile-nav-account .loginBtn {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    gap: 12px;
    justify-content: center;
    padding: 0 12px;
  }

  .mobile-nav-account .loginBtn svg {
    width: 20px;
    height: 20px;
  }
}

@media only screen and (max-width: 480px) {
  .header {
    column-gap: 8px;
    padding: 8px;
    border-radius: calc(var(--border-radius) + 4px);
  }

  .header__logo {
    max-width: calc(100vw - 86px);
    font-size: 0.92rem;
  }

  .mobile-nav-account .loginBtn svg {
    width: 19px;
    height: 19px;
  }

  .header__button .mobile-nav-toggle {
    width: 38px;
    height: 38px;
  }
}

.header .loginBtn:hover {
  color: var(--accent);
  background-color: rgba(184, 156, 255, 0.16);
  border-color: rgba(184, 156, 255, 0.55);
}

.header .loginBtn.is-checking {
  cursor: progress;
  opacity: 0.55;
  pointer-events: none;
}

.header .user-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #150f20;
  background: linear-gradient(145deg, #d2c1ff, var(--accent));
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 11px;
  box-shadow: 0 8px 20px rgba(99, 64, 168, 0.28);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  place-items: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.header .user-avatar:hover {
  color: #150f20;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 10px 26px rgba(99, 64, 168, 0.42);
  transform: translateY(-2px);
}

.user-avatar__visual {
  display: grid;
  overflow: hidden;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  place-items: center;
}

.user-avatar__label {
  display: none;
}

@media only screen and (max-width: 1024px) {
  .header .mobile-nav-account .user-avatar {
    display: flex;
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    gap: 10px;
    justify-content: flex-start;
    padding: 5px 10px;
    color: var(--black);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    box-shadow: none;
    letter-spacing: normal;
  }

  .header .mobile-nav-account .user-avatar:hover {
    color: var(--accent);
    background: rgba(184, 156, 255, 0.08);
    border: 1px solid rgba(184, 156, 255, 0.35);
    box-shadow: none;
    transform: none;
  }

  .mobile-nav-account .user-avatar__visual {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    color: #150f20;
    background: linear-gradient(145deg, #d2c1ff, var(--accent));
    border-radius: 8px;
  }

  .mobile-nav-account .user-avatar__label {
    display: block;
    overflow: hidden;
    min-width: 0;
    color: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header .mobile-nav-account .user-avatar::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.18s ease;
  }

  .header .mobile-nav-account .user-avatar[aria-expanded="true"]::after {
    transform: translateY(2px) rotate(225deg);
  }
}

.user-menu[hidden] {
  display: none;
}

.user-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 12px);
  right: 0;
  width: min(300px, calc(100vw - 24px));
  box-sizing: border-box;
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(184, 156, 255, 0.08), transparent 50%),
    rgba(24, 20, 31, 0.98);
  border: 1px solid rgba(184, 156, 255, 0.24);
  border-radius: calc(var(--border-radius) + 8px);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.52);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.user-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.user-menu__profile {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 4px 14px;
}

.user-menu__avatar {
  display: grid;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  color: #150f20;
  background: linear-gradient(145deg, #d2c1ff, var(--accent));
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  place-items: center;
}

.header .user-avatar img,
.user-menu__avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.user-menu__profile div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.user-menu__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu__role {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-menu__email {
  overflow: hidden;
  color: var(--gray);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu__actions {
  display: grid;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.user-menu__action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

.user-menu__action:hover {
  color: var(--accent);
  background-color: rgba(255, 255, 255, 0.04);
}

.user-menu__action--primary {
  color: var(--background);
  background-color: var(--accent);
}

.user-menu__action--primary:hover {
  color: var(--background);
  background-color: #c8b2ff;
}

.header .user-menu__logout {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  padding: 0 11px;
  color: #ff9693;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.86rem;
}

.header .user-menu__logout:hover {
  color: #ffaaa7;
  background-color: rgba(239, 83, 80, 0.08);
  border: 1px solid rgba(239, 83, 80, 0.18);
}

.header .user-menu__logout:disabled {
  cursor: wait;
  opacity: 0.6;
}

.user-menu__status {
  min-height: 0;
  margin: 8px 4px 0;
  color: var(--red);
  font-size: 0.78rem;
}

.admin-compose-shortcut {
  position: fixed;
  z-index: 90;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  overflow: hidden;
  display: inline-flex;
  width: 54px;
  min-height: 54px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  color: #150f20;
  background: linear-gradient(145deg, #d2c1ff, var(--accent));
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 17px;
  box-shadow: 0 16px 36px rgba(89, 55, 160, 0.42);
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.admin-compose-shortcut svg {
  flex: 0 0 auto;
}

.admin-compose-shortcut:hover,
.admin-compose-shortcut:focus-visible {
  color: #150f20;
  box-shadow: 0 18px 42px rgba(89, 55, 160, 0.55);
  transform: translateY(-3px);
}

@media only screen and (max-width: 520px) {
  .admin-compose-shortcut {
    width: 50px;
    min-height: 50px;
    padding: 0;
    border-radius: 15px;
  }
}

@media only screen and (max-width: 1024px) {
  .mobile-nav-account .user-menu {
    position: static;
    width: 100%;
    margin-top: 10px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    transform: none;
    transition: none;
  }

  html.js .header:not(.is-nav-open) .mobile-nav-account .user-menu {
    display: none;
  }

  .mobile-nav-account .user-menu__profile {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .user-menu,
  .mobile-nav-toggle span,
  .admin-compose-shortcut {
    transition: none;
  }
}

body.modal-open {
  overflow: hidden;
}

.login-modal[hidden] {
  display: none;
}

.login-modal {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.login-modal.is-open {
  opacity: 1;
}

.login-modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(5, 3, 8, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.login-modal__dialog {
  position: relative;
  width: min(100%, 430px);
  box-sizing: border-box;
  padding: clamp(1.5rem, 5vw, 2.25rem);
  background:
    linear-gradient(145deg, rgba(184, 156, 255, 0.08), transparent 45%),
    var(--surface);
  border: 1px solid rgba(184, 156, 255, 0.24);
  border-radius: calc(var(--border-radius) + 10px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.login-modal.is-open .login-modal__dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.login-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--gray);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  place-items: center;
}

.login-modal__close:hover {
  color: var(--accent);
  border-color: rgba(184, 156, 255, 0.48);
}

.login-modal__title {
  margin: 0;
}

.login-modal__copy {
  margin: 10px 0 24px;
  color: var(--gray);
  line-height: 1.6;
}

.login-modal__google {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  box-sizing: border-box;
  padding: 0 16px;
  color: #202124;
  background-color: #fff;
  border: 1px solid #dadce0;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.login-modal__google:hover {
  color: #202124;
  background-color: #f8fafd;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.login-modal__google svg {
  flex: 0 0 auto;
}

.login-modal__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  color: var(--gray);
  font-size: 0.72rem;
  white-space: nowrap;
}

.login-modal__divider::before,
.login-modal__divider::after {
  content: "";
  width: 100%;
  height: 1px;
  background-color: var(--border-color);
}

.login-modal__form {
  display: grid;
  gap: 16px;
}

.login-modal__field {
  display: grid;
  gap: 8px;
  color: var(--gray);
  font-size: 0.85rem;
  font-weight: 600;
}

.login-modal__field input {
  min-height: 48px;
  margin: 0;
}

.login-modal__submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-top: 4px;
  padding: 0 16px;
  color: var(--background);
  background-color: var(--accent);
  border: 0;
  border-radius: var(--border-radius);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.login-modal__submit:hover {
  filter: brightness(1.08);
}

.login-modal__submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.login-modal__status {
  min-height: 1.4em;
  margin: -4px 0 0;
  color: var(--red);
  font-size: 0.85rem;
}

.login-modal__status:empty {
  display: none;
}

.login-page {
  display: grid;
  min-height: min(680px, calc(100vh - 180px));
  padding: 32px 0;
  place-items: center;
}

.login-page__card {
  width: min(100%, 430px);
  box-sizing: border-box;
  padding: clamp(1.5rem, 5vw, 2.25rem);
  background:
    linear-gradient(145deg, rgba(184, 156, 255, 0.08), transparent 45%),
    var(--surface);
  border: 1px solid rgba(184, 156, 255, 0.24);
  border-radius: calc(var(--border-radius) + 10px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.login-page__card h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3rem);
}

.login-page__card > p {
  margin: 10px 0 24px;
  color: var(--gray);
}

/* HTML Post Editor */
.write-editor {
  padding: 18px 0 48px;
}

.write-editor__header {
  margin-bottom: 24px;
}

.write-editor__header h1 {
  max-width: 720px;
  margin: 8px 0 0;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.write-editor__header > div > p:last-child {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--gray);
  line-height: 1.65;
}

.write-editor__back {
  margin-bottom: 28px;
}

.back-button {
  display: inline-flex;
  min-height: 38px;
  box-sizing: border-box;
  gap: 9px;
  align-items: center;
  padding: 0 14px;
  color: var(--gray);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(184, 156, 255, 0.045));
  border: 1px solid var(--border-color);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.back-button span:first-child {
  color: var(--accent);
  font-size: 1rem;
  transition: transform 0.18s ease;
}

.back-button:hover {
  color: var(--black);
  background-color: rgba(184, 156, 255, 0.1);
  border-color: rgba(184, 156, 255, 0.4);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.back-button:hover span:first-child {
  transform: translateX(-3px);
}

.write-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.write-canvas,
.write-panel {
  background-color: rgba(18, 14, 24, 0.78);
  border: 1px solid var(--border-color);
  border-radius: calc(var(--border-radius) + 8px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
}

.write-canvas {
  overflow: hidden;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.write-title {
  position: relative;
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--gray);
  font-size: 0.82rem;
  font-weight: 600;
}

.write-title input {
  min-height: 54px;
  margin: 0;
  padding-right: 68px;
  font-size: 1.05rem;
}

.write-title small {
  position: absolute;
  right: 14px;
  bottom: 18px;
  color: var(--gray);
  font-size: 0.72rem;
  font-weight: 400;
}

.html-editor {
  position: relative;
  overflow: hidden;
  background-color: rgba(9, 7, 12, 0.6);
  border: 1px solid var(--border-color);
  border-radius: calc(var(--border-radius) + 3px);
}

.html-editor__header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.html-editor__header > div:first-child {
  display: grid;
  gap: 3px;
  font-size: 0.85rem;
  font-weight: 700;
}

.html-editor__header small {
  color: var(--gray);
  font-size: 0.7rem;
  font-weight: 400;
}

.html-editor__tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background-color: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

.html-editor__tabs button {
  padding: 6px 10px;
  color: var(--gray);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
}

.html-editor__tabs button.is-active {
  color: var(--black);
  background-color: var(--surface-raised);
}

.html-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
}

.html-toolbar button {
  min-height: 30px;
  padding: 0 9px;
  color: var(--gray);
  background-color: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
}

.html-toolbar button:hover {
  color: var(--accent);
  border-color: rgba(184, 156, 255, 0.4);
}

.html-editor textarea {
  width: 100%;
  min-height: 520px;
  box-sizing: border-box;
  margin: 0;
  padding: 18px;
  color: #ddd6ed;
  background-color: transparent;
  border: 0;
  border-radius: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.75;
  resize: vertical;
  tab-size: 2;
}

.html-editor textarea:focus {
  outline: none;
}

.html-preview {
  min-height: 520px;
  padding: 18px;
  background-color: rgba(12, 10, 16, 0.42);
}

.write-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 16px;
}

.write-panel {
  padding: 16px;
}

.write-panel__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.write-panel__heading small {
  color: var(--gray);
  font-size: 0.7rem;
  font-weight: 400;
}

.write-meta-field {
  display: grid;
  gap: 7px;
  color: var(--gray);
  font-size: 0.75rem;
  font-weight: 600;
}

.write-meta-field + .write-meta-field {
  margin-top: 14px;
}

.write-meta-field input {
  min-height: 42px;
  margin: 0;
  font-size: 0.82rem;
}

.write-meta-field small {
  color: var(--gray);
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.45;
}

.html-tag-autocomplete {
  position: absolute;
  z-index: 30;
  overflow: hidden;
  width: min(260px, calc(100% - 24px));
  box-sizing: border-box;
  padding: 5px;
  background-color: rgba(18, 14, 24, 0.98);
  border: 1px solid rgba(184, 156, 255, 0.3);
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.html-tag-autocomplete[hidden] {
  display: none;
}

.html-tag-autocomplete__options {
  overflow-y: auto;
  display: grid;
  max-height: 248px;
}

.html-tag-autocomplete button {
  display: grid;
  min-height: 38px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 0 9px;
  color: var(--gray);
  background: none;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
}

.html-tag-autocomplete button[hidden] {
  display: none;
}

.html-tag-autocomplete button code {
  overflow: hidden;
  color: #d8c9ff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.html-tag-autocomplete button span {
  color: rgba(170, 163, 181, 0.72);
  font-size: 0.64rem;
}

.html-tag-autocomplete button:hover,
.html-tag-autocomplete button.is-active {
  color: var(--black);
  background-color: rgba(184, 156, 255, 0.12);
  box-shadow: inset 2px 0 var(--accent);
}

.html-tag-autocomplete button:hover code,
.html-tag-autocomplete button.is-active code {
  color: var(--black);
}

.html-tag-autocomplete__hint {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 7px 8px 2px;
  margin-top: 4px;
  color: rgba(170, 163, 181, 0.65);
  border-top: 1px solid var(--border-color);
  font-size: 0.58rem;
  white-space: nowrap;
}

.cover-upload {
  position: relative;
  overflow: hidden;
  display: grid;
  aspect-ratio: 4 / 3;
  color: var(--gray);
  background-color: rgba(12, 10, 16, 0.5);
  border: 1px dashed rgba(184, 156, 255, 0.3);
  border-radius: var(--border-radius);
  cursor: pointer;
  place-items: center;
}

.cover-upload:hover {
  color: var(--accent);
  border-color: rgba(184, 156, 255, 0.65);
}

.cover-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.cover-upload__placeholder {
  display: grid;
  gap: 8px;
  padding: 18px;
  text-align: center;
  place-items: center;
}

.cover-upload__placeholder strong {
  color: var(--black);
  font-size: 0.82rem;
}

.cover-upload__placeholder small {
  max-width: 190px;
  font-size: 0.7rem;
  line-height: 1.5;
}

.cover-upload img {
  width: var(--cover-preview-width, 100%);
  max-height: 100%;
  justify-self: center;
  object-fit: contain;
}

.cover-size {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  color: var(--gray);
  font-size: 0.75rem;
  font-weight: 600;
}

.cover-size > span {
  display: flex;
  justify-content: space-between;
}

.cover-size output {
  color: var(--accent);
}

.cover-size input {
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.write-guide p {
  margin: 10px 0;
  color: var(--gray);
  font-size: 0.78rem;
  line-height: 1.55;
}

.write-guide > code {
  display: block;
  color: #d1c0f7;
  font-size: 0.72rem;
  line-height: 1.6;
}

.write-guide pre {
  overflow-x: auto;
  margin: 0;
  padding: 10px;
  background-color: rgba(8, 6, 11, 0.7);
  border-radius: 8px;
  font-size: 0.64rem;
  line-height: 1.55;
}

.write-actions {
  position: sticky;
  z-index: 20;
  bottom: 12px;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding: 12px;
  background-color: rgba(18, 14, 24, 0.9);
  border: 1px solid var(--border-color);
  border-radius: calc(var(--border-radius) + 5px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.34);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.write-actions > div {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.write-actions button {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
}

.write-actions__preview {
  color: var(--black);
  background-color: transparent;
  border: 1px solid var(--border-color);
}

.write-actions__draft {
  color: var(--accent);
  background-color: rgba(184, 156, 255, 0.08);
  border: 1px solid rgba(184, 156, 255, 0.28);
}

.write-actions__publish {
  color: var(--background);
  background-color: var(--accent);
  border: 1px solid var(--accent);
}

.write-actions__publish:disabled {
  cursor: wait;
  opacity: 0.65;
}

.write-actions__draft:disabled {
  cursor: wait;
  opacity: 0.65;
}

.write-form__status {
  margin: 0;
  color: var(--gray);
  font-size: 0.8rem;
}

.live-preview-toolbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  box-sizing: border-box;
  padding: 10px max(16px, calc((100vw - 1120px) / 2));
  background-color: rgba(18, 14, 24, 0.9);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.24);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.live-preview-toolbar > div {
  display: grid;
  gap: 3px;
}

.live-preview-toolbar__label {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
}

.live-preview-toolbar__label i {
  width: 7px;
  height: 7px;
  background-color: #71d99c;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(113, 217, 156, 0.1);
}

.live-preview-toolbar__status {
  color: var(--gray);
  font-size: 0.67rem;
}

.live-preview-page.is-disconnected .live-preview-toolbar__label i {
  background-color: var(--gray);
  box-shadow: none;
}

.live-preview-toolbar__close {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  color: var(--black);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.live-preview-toolbar__close:hover {
  color: var(--accent);
  border-color: rgba(184, 156, 255, 0.45);
}

.live-preview-main {
  min-height: calc(100vh - 68px);
}

.live-preview-article {
  width: min(calc(100% - 32px), 820px);
}

.live-preview-article > .post-page__cover[hidden] + .post-page__header {
  margin-top: 0;
}

@media only screen and (max-width: 860px) {
  .write-layout {
    grid-template-columns: 1fr;
  }

  .write-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media only screen and (max-width: 560px) {
  .live-preview-toolbar {
    min-height: 62px;
  }

  .live-preview-toolbar__status {
    max-width: 48vw;
  }

  .live-preview-toolbar__close {
    padding: 0 11px;
  }

  .live-preview-toolbar__close span {
    display: none;
  }

  .html-editor__header {
    align-items: stretch;
    flex-direction: column;
  }

  .html-editor__tabs {
    align-self: start;
  }

  .html-editor textarea,
  .html-preview {
    min-height: 430px;
  }

  .write-sidebar {
    grid-template-columns: 1fr;
  }

  .write-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .write-actions > div {
    width: 100%;
    margin-left: 0;
  }

  .write-actions button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-modal,
  .login-modal__dialog {
    transition: none;
  }
}

/* Header -> Navigation */
.header__nav ul {
  list-style-type: none;
  display: grid;
  width: 100%;
  grid-template-columns: 1fr;
  gap: 2px;
  font-weight: 600;
  margin: 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--border-color);
}

.header__nav li {
  min-width: 0;
}

.header__nav ul a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 40px;
  padding: 0 12px;
  color: var(--gray);
  border-radius: 8px;
  font-size: 0.82rem;
  text-decoration: none;
}

@media only screen and (min-width: 1025px) {
  .header__logo {
    overflow: visible;
    min-width: auto;
    max-width: none;
    font-size: clamp(0.95rem, 3.8vw, 1.35rem);
    text-overflow: clip;
  }

  .header__nav {
    flex-direction: row;
  }

  .header__nav ul {
    display: flex;
    width: auto;
    gap: clamp(0.25rem, 3vw, 1rem);
    padding: 0;
    border-top: 0;
  }

  .header__nav ul a {
    display: block;
    min-height: 0;
    padding: 6px;
    color: var(--black);
    border-radius: 0;
    font-size: var(--font-size-base);
  }

  .header__button .mobile-nav-toggle {
    display: none;
  }
}



.header__nav ul a:hover {
  color: var(--accent);
  background-color: rgba(184, 156, 255, 0.08);
}

.header__nav ul a.active {
  color: var(--black);
  background-color: rgba(184, 156, 255, 0.12);
}

@media only screen and (min-width: 1025px) {
  .header__nav ul a:hover {
    color: var(--accent);
    background-color: transparent;
    text-decoration: underline;
  }

  .header__nav ul a.active {
    color: var(--gray);
    background-color: transparent;
  }
}

/* Search Page Heading */
.author {
  padding: 10px 0;
  text-align: center;
}

/* Home Intro */
.home-intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: clamp(1.5rem, 4vw, 3rem) 0;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 3rem);
  background:
    linear-gradient(120deg, rgba(184, 156, 255, 0.12), transparent 55%),
    var(--surface);
  border: 1px solid var(--border-color);
  border-radius: calc(var(--border-radius) + 12px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.home-intro::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -10rem;
  right: -8rem;
  width: 28rem;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(120, 83, 196, 0.28), transparent 68%);
}

.home-intro__eyebrow {
  margin: 0 0 0.85rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.home-intro__heading {
  max-width: 650px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.home-intro__heading span {
  color: var(--accent);
}

.home-intro__body {
  max-width: 570px;
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin: 1rem 0 0;
  color: var(--gray);
  line-height: 1.65;
}

/* Home Articles */
.articles {
  scroll-margin-top: 100px;
}

.articles.is-loading {
  cursor: progress;
}

.articles.is-loading .article-grid,
.articles.is-loading .pagination {
  opacity: 0.38;
  pointer-events: none;
}

.articles__topbar {
  display: flex;
  gap: 24px;
  align-items: end;
  justify-content: space-between;
  margin: 4rem 0 0;
}

.articles__eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.articles__heading {
  margin: 0;
  font-weight: 400;
}

.article-tools {
  display: flex;
  gap: 10px;
  align-items: center;
}

.article-filter {
  position: relative;
  display: block;
  width: min(260px, 100%);
}

.article-filter svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  color: var(--gray);
  pointer-events: none;
  transform: translateY(-50%);
}

.article-filter input,
.article-sort select {
  height: 44px;
  margin: 0;
  background-color: rgba(24, 20, 31, 0.78);
  border-color: var(--border-color);
}

.article-filter input {
  padding: 0 14px 0 42px;
}

.article-sort select {
  min-width: 140px;
  padding: 0 12px;
  cursor: pointer;
}

.article-results {
  margin: 12px 0 20px;
  color: var(--gray);
  font-size: 0.85rem;
}

.article-empty {
  padding: 2.5rem 1rem;
  color: var(--gray);
  background-color: rgba(24, 20, 31, 0.55);
  border: 1px dashed var(--border-color);
  border-radius: calc(var(--border-radius) + 4px);
  text-align: center;
}

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

@media only screen and (max-width: 640px) {
  .articles__topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .article-tools {
    align-items: stretch;
  }

  .article-filter {
    flex: 1;
    width: auto;
  }

  .article-sort select {
    min-width: 125px;
  }
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  transition: opacity 0.18s ease;
}

@media only screen and (min-width: 620px) {
  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media only screen and (min-width: 900px) {
  .article-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.article-card {
  overflow: hidden;
  background: linear-gradient(145deg, rgba(33, 27, 44, 0.96), rgba(21, 17, 28, 0.96));
  border: 1px solid var(--border-color);
  border-radius: calc(var(--border-radius) + 6px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.article-card[hidden] {
  display: none;
}

.article-card:hover {
  border-color: rgba(184, 156, 255, 0.5);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.42);
  transform: translateY(-4px);
}

.article-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
}

.article-card__image {
  aspect-ratio: 8 / 5;
  filter: brightness(0.8) saturate(0.8);
  object-fit: cover;
  transition: filter 0.2s ease;
}

.article-card:hover .article-card__image {
  filter: brightness(0.95) saturate(0.95);
}

.article-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.article-card__date {
  color: var(--gray);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.article-card__tags span {
  padding: 3px 7px;
  color: var(--accent);
  background-color: rgba(184, 156, 255, 0.09);
  border: 1px solid rgba(184, 156, 255, 0.18);
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
}

.article-card__title {
  margin: 10px 0 8px;
  line-height: 1.3;
}

.article-card__excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 20px;
  color: var(--gray);
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.article-card__read-more {
  margin-top: auto;
  color: var(--accent);
  font-weight: 600;
}

.article-ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  font-size: clamp(1.13rem, calc(1.08rem + 0.22vw), 1.25rem);
  display: flex;
  flex-direction: column;
}

.article-list__date {
  font-size: var(--font-size-base);
  color: var(--gray);
  width: 260px;
  display: inline-block;
}

.article-ul li a {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  margin: 18px 0;
}

@media only screen and (min-width: 768px) {
  .article-ul li a {
    flex-direction: row;
    align-items: center;
  }

  .article-list__date {
    text-align: right;
  }
}

.article-ul li {
  font-size: 24px;
  cursor: pointer;
  transition: filter 0.1s;
}

.article-ul li:not(:last-child) {
  border-bottom: 1px solid var(--gray-light);
}


.article-ul li:hover {
  filter: none;
}

.article-ul:hover li {
  filter: blur(3px);
}

.article-ul:hover li:hover {
  filter: none;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 36px;
  transition: opacity 0.18s ease;
}

.pagination__pages {
  display: flex;
  gap: 8px;
}

.pagination__button,
.pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  box-sizing: border-box;
  color: var(--gray);
  background-color: rgba(24, 20, 31, 0.78);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.pagination__button {
  gap: 7px;
  padding: 0 14px;
}

.pagination__page {
  width: 42px;
}

.pagination__button:not(.pagination__button--disabled):hover,
.pagination__page:hover {
  color: var(--accent);
  border-color: rgba(184, 156, 255, 0.5);
  transform: translateY(-2px);
}

.pagination__page--current {
  color: var(--background);
  background-color: var(--accent);
  border-color: var(--accent);
}

.pagination__button--disabled {
  cursor: not-allowed;
  opacity: 0.38;
}



.post-page {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) 0;
}

.post-page__back {
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.post-page__header {
  max-width: 780px;
}

.post-page__cover + .post-page__header {
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.post-page__header time {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-page__header h1 {
  margin: 14px 0 0;
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.post-tags li {
  padding: 5px 10px;
  color: var(--accent);
  background-color: rgba(184, 156, 255, 0.1);
  border: 1px solid rgba(184, 156, 255, 0.2);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.post-page__cover {
  display: block;
  width: var(--cover-width, 100%);
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  border: 1px solid var(--border-color);
  border-radius: calc(var(--border-radius) + 8px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  object-fit: cover;
}

.article {
  white-space: normal;
}

.article-content {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  color: #d2cdd9;
  font-size: clamp(1rem, 1.5vw, 1.08rem);
  line-height: 1.85;
}

.html-preview.article-content {
  margin-top: 0;
}

.article-content > :first-child {
  margin-top: 0;
}

.article-content > :last-child {
  margin-bottom: 0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  margin: 2em 0 0.65em;
  color: var(--black);
  line-height: 1.25;
}

.article-content h2 {
  font-size: clamp(1.55rem, 4vw, 2.15rem);
}

.article-content h3 {
  font-size: clamp(1.25rem, 3vw, 1.6rem);
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content pre,
.article-content figure,
.article-content table {
  margin: 1.35em 0;
}

.article-content a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.article-content blockquote {
  padding: 0.25rem 0 0.25rem 1.25rem;
  color: #bbb3c7;
  border-left: 3px solid var(--accent);
}

.article-content code {
  padding: 0.15em 0.4em;
  color: #d8c8ff;
  background-color: rgba(184, 156, 255, 0.1);
  border-radius: 5px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

.article-content pre {
  overflow-x: auto;
  padding: 1.1rem;
  background-color: #09070c;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  line-height: 1.65;
}

.article-content pre code {
  padding: 0;
  color: #ddd6ed;
  background: none;
  border-radius: 0;
}

.article-content img {
  height: auto;
  border-radius: var(--border-radius);
}

.article-content figure img {
  display: block;
}

.article-content figcaption {
  margin-top: 8px;
  color: var(--gray);
  font-size: 0.78rem;
  text-align: center;
}

.article-content table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
}

.article-content th,
.article-content td {
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  text-align: left;
}

/* Footer */
.footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: clamp(3rem, 8vw, 6rem) 0 18px;
  padding: clamp(1.4rem, 4vw, 2.25rem);
  color: var(--gray);
  background:
    linear-gradient(125deg, rgba(184, 156, 255, 0.11), transparent 52%),
    rgba(18, 14, 24, 0.82);
  border: 1px solid var(--border-color);
  border-radius: calc(var(--border-radius) + 12px);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
}

.footer::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -7rem;
  bottom: -9rem;
  width: 20rem;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(90, 65, 150, 0.26), transparent 68%);
}

.footer__main,
.footer__bottom {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.footer__intro {
  max-width: 520px;
}

.footer__brand {
  color: var(--accent);
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: 800;
  text-decoration: none;
}

.footer__brand:hover {
  color: #d1c1fa;
}

.footer__intro p {
  margin: 10px 0 0;
  font-size: 0.86rem;
  line-height: 1.7;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.footer__nav a {
  padding: 7px 11px;
  color: var(--gray);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.footer__nav a:hover {
  color: var(--black);
  background-color: rgba(184, 156, 255, 0.08);
  border-color: rgba(184, 156, 255, 0.22);
}

.footer__bottom {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  font-size: 0.72rem;
}

.footer__build {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.footer__build i {
  width: 6px;
  height: 6px;
  background-color: #75d6a1;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(117, 214, 161, 0.1);
}

@media only screen and (max-width: 620px) {
  .footer__main,
  .footer__bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer__nav {
    justify-content: flex-start;
  }
}

/* SearchBar */
.searchBar {
  visibility: hidden;
  position: fixed;
  z-index: 100;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  box-sizing: border-box;
  width: min(calc(100% - 24px), 720px);
  padding: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 24px));
  background: rgba(24, 20, 31, 0.95);
  border: 1px solid var(--border-color);
  border-radius: calc(var(--border-radius) + 6px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  transition:
    opacity 0.18s ease,
    transform 0.22s ease,
    visibility 0s linear 0.22s;
}

.searchBar.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.48),
    0 0 0 100vmax rgba(6, 4, 9, 0.38);
  transition-delay: 0s;
}

.searchBar .container {
  position: relative;
  max-width: none;
  padding: 0;
}

.search__form {
  margin: 0;
}

.searchBar input {
  margin: 0;
  min-height: 52px;
  padding: 12px 88px 12px 16px;
  background-color: rgba(12, 10, 16, 0.82);
  border-color: rgba(184, 156, 255, 0.28);
}

#searchClose {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--accent);
  cursor: pointer;
  padding: 7px 10px;
  background-color: rgba(184, 156, 255, 0.1);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  transform: translateY(-50%);
  user-select: none;
}

#searchClose:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Admin Dashboard */
.dashboard-page .container {
  max-width: 1120px;
}

.dashboard-main {
  padding-top: 104px;
}

.admin-title {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  gap: 32px;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.5rem, 5vw, 3rem);
  background:
    linear-gradient(120deg, rgba(184, 156, 255, 0.13), transparent 58%),
    var(--surface);
  border: 1px solid var(--border-color);
  border-radius: calc(var(--border-radius) + 10px);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.26);
}

.admin-title::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -11rem;
  right: -8rem;
  width: 26rem;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(113, 76, 188, 0.3), transparent 68%);
}

.admin-eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-title h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.admin-title__description {
  max-width: 570px;
  margin: 12px 0 0;
  color: var(--gray);
  line-height: 1.65;
}

.admin-title__action {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 9px;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  color: var(--background);
  background-color: var(--accent);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 24px rgba(128, 88, 210, 0.24);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.admin-title__action span {
  font-size: 1.25rem;
  line-height: 1;
}

.admin-title__action:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

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

.dashboard-stat {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px;
  background-color: rgba(24, 20, 31, 0.72);
  border: 1px solid var(--border-color);
  border-radius: calc(var(--border-radius) + 5px);
}

.dashboard-stat__icon {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  color: var(--accent);
  background-color: rgba(184, 156, 255, 0.1);
  border-radius: 12px;
  place-items: center;
}

.dashboard-stat--status .dashboard-stat__icon {
  color: #75d6a1;
  background-color: rgba(117, 214, 161, 0.1);
}

.dashboard-stat div {
  display: grid;
  gap: 3px;
}

.dashboard-stat strong {
  font-size: 1.35rem;
  line-height: 1;
}

.dashboard-stat div span {
  color: var(--gray);
  font-size: 0.82rem;
}

.dashboard-panel {
  margin-top: 28px;
  padding: clamp(1.25rem, 3vw, 2rem);
  background-color: rgba(18, 14, 24, 0.75);
  border: 1px solid var(--border-color);
  border-radius: calc(var(--border-radius) + 10px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.2);
}

.dashboard-panel__header {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
}

.dashboard-panel__header h2 {
  margin: 0;
}

.dashboard-panel__count {
  color: var(--gray);
  font-size: 0.85rem;
}

.dashboard-toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  margin: 24px 0 12px;
}

.dashboard-search {
  position: relative;
  display: block;
  flex: 1;
}

.dashboard-search svg {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--gray);
  pointer-events: none;
  transform: translateY(-50%);
}

.dashboard-search input {
  min-height: 46px;
  margin: 0;
  padding-left: 42px;
  background-color: rgba(12, 10, 16, 0.76);
}

.dashboard-sort {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--gray);
  font-size: 0.75rem;
  font-weight: 600;
}

.dashboard-sort select {
  min-height: 46px;
  margin: 0;
  padding: 0 12px;
  background-color: rgba(12, 10, 16, 0.76);
  cursor: pointer;
}

.dashboard-bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  box-sizing: border-box;
  margin-bottom: 10px;
  padding: 8px 10px;
  background-color: rgba(12, 10, 16, 0.58);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.dashboard-select-all {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
}

.dashboard-select-all input,
.admin-posts__checkbox {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.dashboard-select-all input:disabled,
.admin-posts__checkbox:disabled {
  cursor: wait;
}

.dashboard-bulk__count {
  color: var(--gray);
  font-size: 0.76rem;
}

.dashboard-bulk__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-left: auto;
}

.dashboard-bulk__actions button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--black);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
}

.dashboard-bulk__actions button:hover:not(:disabled) {
  color: var(--accent);
  border-color: rgba(184, 156, 255, 0.45);
}

.dashboard-bulk__actions .dashboard-bulk__delete {
  color: #ff9693;
  background-color: rgba(239, 83, 80, 0.07);
}

.dashboard-bulk__actions button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.dashboard-bulk__status {
  margin: 0 2px 10px;
  color: #8bd9ad;
  font-size: 0.76rem;
}

.dashboard-bulk__status:empty {
  display: none;
}

.dashboard-bulk__status.is-error {
  color: #ff9693;
}

.admin-posts {
  overflow: hidden;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border-color);
  border-radius: calc(var(--border-radius) + 4px);
  list-style: none;
}

.admin-posts li {
  display: grid;
  grid-template-columns: 24px 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 12px 16px;
  background-color: rgba(24, 20, 31, 0.55);
  transition: background-color 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.admin-posts li.is-removing {
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px);
}

.admin-posts li + li {
  border-top: 1px solid var(--border-color);
}

.admin-posts li:hover {
  background-color: rgba(33, 27, 44, 0.8);
}

.admin-posts li.is-selected {
  background-color: rgba(184, 156, 255, 0.09);
}

.admin-posts li.has-bulk-error {
  box-shadow: inset 3px 0 #ff7773;
}

.admin-posts li[hidden] {
  display: none;
}

.admin-posts__number {
  color: rgba(170, 163, 181, 0.62);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.admin-posts__details {
  min-width: 0;
}

.admin-posts__title {
  display: inline-block;
  overflow: hidden;
  max-width: 100%;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-posts__title:hover {
  color: var(--accent);
}

.admin-posts__meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.admin-posts__status {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #8bd9ad;
  font-size: 0.72rem;
  font-weight: 600;
}

.admin-posts__status i {
  width: 6px;
  height: 6px;
  background-color: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(139, 217, 173, 0.1);
}

.admin-posts__status--draft {
  color: #e4bc73;
}

.admin-posts__status--draft i {
  box-shadow: 0 0 0 3px rgba(228, 188, 115, 0.1);
}

.admin-posts-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-posts-controls form {
  display: flex;
  margin: 0;
}

.admin-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 11px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}

.admin-action--edit {
  color: var(--black);
  background-color: rgba(255, 255, 255, 0.04);
}

.admin-action--delete {
  color: #ff8d8a;
  background-color: rgba(239, 83, 80, 0.08);
}

.admin-action--delete:disabled {
  cursor: wait;
  opacity: 0.55;
}

.admin-action:hover {
  border-color: rgba(184, 156, 255, 0.45);
}

.dashboard-empty {
  padding: 3rem 1rem;
  margin: 0;
  color: var(--gray);
  text-align: center;
}

@media only screen and (max-width: 720px) {
  .admin-title {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-title__action {
    align-self: start;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-sort {
    min-width: 0;
  }

  .dashboard-bulk {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-bulk__actions {
    width: 100%;
    margin-left: 0;
  }

  .admin-posts li {
    grid-template-columns: 24px 30px minmax(0, 1fr);
  }

  .admin-posts-controls {
    grid-column: 3;
    justify-self: start;
  }
}

@media only screen and (max-width: 420px) {
  .dashboard-main {
    padding-top: 22px;
  }

  .dashboard-panel {
    padding: 14px;
  }

  .admin-posts li {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .admin-posts__number {
    display: none;
  }

  .admin-posts-controls {
    grid-column: 2;
  }
}
