:root {
  --mouse-x: 50vw;
  --mouse-y: 30vh;
  --bg: #050505;
  --panel: rgba(14, 14, 14, 0.9);
  --panel-2: rgba(28, 28, 28, 0.78);
  --text: #f4f4f4;
  --muted: #a5a5a5;
  --soft: #d8d8d8;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.28);
  --danger: #c73a3a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.68);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.18), transparent 14rem),
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.1), transparent 18rem),
    linear-gradient(125deg, #151515, #030303 42%, #111111 70%, #000000);
  background-size: 100% 100%, 100% 100%, 160% 160%;
  animation: backgroundDrift 12s ease-in-out infinite alternate;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.15;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

body::after {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -3;
  opacity: 0.22;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.16), transparent 12rem),
    radial-gradient(circle at 80% 65%, rgba(255, 255, 255, 0.08), transparent 16rem);
  filter: blur(10px);
  animation: slowOrbit 16s linear infinite;
}

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

img {
  display: block;
  max-width: 100%;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.065;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
}

.interactive-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(255, 255, 255, 0.055) 43%, transparent 44% 100%),
    linear-gradient(65deg, transparent 0 54%, rgba(255, 255, 255, 0.04) 55%, transparent 56% 100%);
  background-size: 220px 220px, 180px 180px;
  animation: circuitSlide 18s linear infinite;
  mask-image: radial-gradient(circle at var(--mouse-x) var(--mouse-y), #000 0 26rem, transparent 44rem);
}

.click-burst {
  position: fixed;
  z-index: 100;
  width: 18px;
  height: 18px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  animation: clickBurst 650ms ease-out forwards;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(260px, 640px) auto;
  gap: 16px;
  align-items: center;
  min-height: 78px;
  padding: 13px clamp(14px, 4vw, 46px);
  background: rgba(5, 5, 5, 0.84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand,
.auth-actions,
.button,
.youtube-button {
  display: inline-flex;
  align-items: center;
}

.brand {
  min-width: 0;
  gap: 12px;
  font-size: clamp(0.96rem, 2vw, 1.15rem);
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.18);
}

.brand-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 2px solid #f2f2f2;
  border-radius: 999px;
  filter: grayscale(1) contrast(1.12);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12), 0 0 28px rgba(255, 255, 255, 0.16);
}

.search-shell {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.1), 0 14px 38px rgba(0, 0, 0, 0.42);
}

.search-shell:focus-within {
  border-color: rgba(255, 255, 255, 0.46);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08), 0 14px 38px rgba(0, 0, 0, 0.42);
}

.search-shell span {
  position: relative;
  width: 17px;
  height: 17px;
  border: 2px solid var(--soft);
  border-radius: 999px;
}

.search-shell span::after {
  content: "";
  position: absolute;
  right: -7px;
  bottom: -6px;
  width: 8px;
  height: 2px;
  background: var(--soft);
  transform: rotate(45deg);
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-weight: 700;
}

.search-shell input {
  min-height: 52px;
  background: transparent;
}

input::placeholder,
textarea::placeholder {
  color: #7d7d7d;
}

select option {
  color: #050505;
}

.auth-actions {
  justify-self: end;
  gap: 9px;
}

.button {
  min-height: 42px;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover,
.youtube-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.54);
}

.button.primary {
  color: #050505;
  background: linear-gradient(145deg, #ffffff, #9d9d9d);
  border-color: #ffffff;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.06);
}

.button.compact {
  min-height: 38px;
  padding: 0 13px;
  font-size: 0.9rem;
}

.button.danger {
  color: #fff;
  background: rgba(199, 58, 58, 0.18);
  border-color: rgba(199, 58, 58, 0.5);
}

.user-pill {
  max-width: 150px;
  overflow: hidden;
  padding: 10px 13px;
  color: #050505;
  background: #e9e9e9;
  border-radius: 999px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero {
  width: min(1360px, calc(100% - 28px));
  margin: 24px auto 0;
  animation: rise 620ms ease both;
}

.hero-banner {
  width: 100%;
  aspect-ratio: 2.8 / 1;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: var(--shadow), 0 0 46px rgba(255, 255, 255, 0.08);
}

.admin-panel,
.feed-header,
.post-card,
.auth-box {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(28, 28, 28, 0.9), rgba(8, 8, 8, 0.86));
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.5), inset 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.avatar {
  width: clamp(88px, 14vw, 136px);
  height: clamp(88px, 14vw, 136px);
  flex: 0 0 auto;
  object-fit: cover;
  border: 4px solid #f5f5f5;
  border-radius: 999px;
  filter: grayscale(1) contrast(1.1);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1), 0 18px 48px rgba(0, 0, 0, 0.66);
}

.section-kicker {
  margin: 0 0 8px;
  color: #ededed;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 6.4vw, 5.2rem);
  line-height: 0.9;
  letter-spacing: 0;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.9);
}

h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.7rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 0.98rem;
}

.admin-panel,
.feed-header,
.posts,
.empty-state,
.youtube-section {
  width: min(1180px, calc(100% - 28px));
}

.admin-panel {
  display: grid;
  gap: 22px;
  margin: 34px auto 0;
  padding: clamp(18px, 4vw, 28px);
  border-radius: 18px;
  animation: rise 660ms ease both;
}

.post-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.post-form label:nth-child(4) {
  grid-column: 1 / -1;
}

.publish-message {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-size: 0.9rem;
  font-weight: 900;
}

label input,
label textarea,
label select,
.comment-form textarea {
  min-height: 48px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.captcha-row span {
  color: var(--soft);
}

.bot-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

textarea {
  resize: vertical;
}

.feed-header {
  display: flex;
  justify-content: flex-end;
  margin: 36px auto 0;
  padding: 12px 0 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.feed-header p {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
  text-align: right;
}

.posts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 24px auto 0;
}

.post-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  animation: rise 720ms ease both;
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: 0 28px 76px rgba(0, 0, 0, 0.65), 0 0 30px rgba(255, 255, 255, 0.08);
}

.post-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  border-bottom: 1px solid var(--line);
  filter: grayscale(1) contrast(1.08) brightness(0.88);
}

.post-body {
  min-height: 230px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 20px;
}

.post-body h2 {
  font-size: clamp(1.18rem, 2.2vw, 1.55rem);
  line-height: 1.12;
}

.post-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.pin-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: #050505;
  background: #e8e8e8;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.post-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.post-meta {
  color: #8f8f8f !important;
  font-size: 0.86rem;
  font-weight: 800;
}

.download-link,
.youtube-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  color: #050505;
  background: linear-gradient(145deg, #ffffff, #9c9c9c);
  border: 1px solid #ffffff;
  border-radius: 999px;
  font-weight: 900;
}

.post-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-self: end;
}

.like-chip {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  color: var(--text);
  background: linear-gradient(145deg, #242424, #101010);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 10px 24px rgba(0, 0, 0, 0.32);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.like-icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  background: url("assets/likebutton.png") center / contain no-repeat;
  filter: grayscale(1) brightness(1.45) contrast(1.08);
}

.like-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.34);
  background: linear-gradient(145deg, #303030, #151515);
}

.square-action {
  border-radius: 0;
}

.comments {
  display: grid;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.comment-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.comment {
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.comment-top {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 4px;
}

.comment strong {
  font-size: 0.84rem;
}

.comment time {
  color: #858585;
  font-size: 0.76rem;
  font-weight: 800;
}

.comment p {
  font-size: 0.92rem;
}

.comment-delete {
  margin-left: auto;
  padding: 0;
  border: 0;
  color: #d8d8d8;
  background: transparent;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.no-comments {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.comment-form {
  display: grid;
  gap: 8px;
}

.comment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: #f0b8b8;
  font-size: 0.9rem;
  font-weight: 800;
}

.empty-state {
  margin: 28px auto 0;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.youtube-section {
  display: grid;
  place-items: center;
  margin: 56px auto 46px;
}

.youtube-button {
  gap: 12px;
  min-height: 60px;
  padding: 0 clamp(22px, 5vw, 42px);
  color: var(--text);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  border-color: var(--line-strong);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.5), inset 0 1px rgba(255, 255, 255, 0.16);
  font-size: clamp(1rem, 3vw, 1.2rem);
}

.post-page {
  width: min(1180px, calc(100% - 28px));
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1fr);
  overflow: hidden;
  margin: 28px auto 52px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(28, 28, 28, 0.9), rgba(8, 8, 8, 0.86));
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.5), inset 0 1px rgba(255, 255, 255, 0.08);
  animation: rise 500ms ease both;
}

.post-page-image {
  width: 100%;
  height: 100%;
  min-height: 540px;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08) brightness(0.84);
}

.post-page-body {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: clamp(20px, 4vw, 36px);
}

.post-page-body h2 {
  font-size: clamp(2.2rem, 5vw, 4.4rem);
}

.post-page-body > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.back-arrow {
  width: 58px;
  height: 58px;
  display: inline-grid;
  place-items: center;
  justify-self: start;
  padding: 0;
  color: #ffffff;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 3.1rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.34), 0 10px 28px rgba(0, 0, 0, 0.75);
  transition: transform 160ms ease, text-shadow 160ms ease;
}

.back-arrow:hover {
  transform: translateX(-5px) scale(1.08);
  text-shadow: 0 0 26px rgba(255, 255, 255, 0.56), 0 12px 32px rgba(0, 0, 0, 0.8);
}

.play-mark {
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
}

.auth-modal {
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
}

.auth-modal {
  width: min(470px, calc(100% - 24px));
}

.auth-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.auth-box {
  position: relative;
  display: grid;
  gap: 15px;
  padding: 26px;
  border-radius: 18px;
}

.icon-close,
.link-button {
  border: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.icon-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
}

.link-button {
  color: var(--soft);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.footer {
  padding: 26px 16px 82px;
  color: #838383;
  text-align: center;
}

.footer p {
  margin: 0;
  font-weight: 900;
}

.mobile-bar {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 35;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 7px;
  background: rgba(10, 10, 10, 0.86);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.mobile-bar a,
.mobile-bar button {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 900;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes backgroundDrift {
  from {
    background-position: center, center, 0% 50%;
  }

  to {
    background-position: center, center, 100% 50%;
  }
}

@keyframes slowOrbit {
  from {
    transform: rotate(0deg) scale(1);
  }

  to {
    transform: rotate(360deg) scale(1.08);
  }
}

@keyframes circuitSlide {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 220px 220px, -180px 180px;
  }
}

@keyframes clickBurst {
  0% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(0.4);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.28);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(4.4);
    box-shadow: 0 0 0 22px rgba(255, 255, 255, 0);
  }
}

@media (max-width: 1050px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .search-shell {
    grid-column: 1 / -1;
    grid-row: 2;
  }

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

@media (max-width: 700px) {
  .topbar {
    gap: 12px;
    padding-inline: 12px;
  }

  .brand span {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .auth-actions {
    gap: 7px;
  }

  .button {
    min-height: 38px;
    padding-inline: 12px;
    font-size: 0.9rem;
  }

  .hero {
    width: min(100% - 18px, 1360px);
    margin-top: 14px;
  }

  .hero-banner {
    aspect-ratio: 2.15 / 1;
    border-radius: 14px;
  }

  .avatar {
    width: 76px;
    height: 76px;
    border-width: 3px;
  }

  .admin-panel,
  .feed-header,
  .posts,
  .empty-state,
  .youtube-section {
    width: min(100% - 18px, 1180px);
  }

  .post-form,
  .posts {
    grid-template-columns: 1fr;
  }

  .feed-header {
    justify-content: flex-start;
  }

  .feed-header p {
    max-width: none;
    text-align: left;
  }

  .post-page {
    width: min(100% - 18px, 1180px);
    grid-template-columns: 1fr;
  }

  .post-page-image {
    min-height: 220px;
    aspect-ratio: 16 / 9;
  }

  .mobile-bar {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
