:root{
  --bg: #0b0f19;
  --panel: rgba(255,255,255,0.06);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.65);
  --border: rgba(255,255,255,0.12);
  --accent: #7c5cff;
  --accent2:#31d0aa;
  --danger:#ff4d6d;
  --shadow: 0 18px 50px rgba(0,0,0,0.55);
  --radius: 16px;
  --radius2: 22px;
  --container: 1120px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(124,92,255,0.35), transparent 60%),
    radial-gradient(900px 700px at 80% 20%, rgba(49,208,170,0.25), transparent 55%),
    radial-gradient(900px 900px at 50% 100%, rgba(255,77,109,0.18), transparent 55%),
    var(--bg);
}

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

.container{
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(11,15,25,0.65);
  border-bottom: 1px solid var(--border);
}
.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 0;
  gap: 16px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 10px;
  text-decoration:none;
}
.brand__mark{
  width: 34px; height:34px;
  border-radius: 12px;
  display:grid; place-items:center;
  font-weight:800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 30px rgba(124,92,255,0.25);
}
.brand__text{ font-weight:700; letter-spacing:0.2px; }

.nav{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav__link{
  color:var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.nav__link:hover{
  color:var(--text);
  border-color: var(--border);
  text-decoration:none;
  background: rgba(255,255,255,0.04);
}
.nav__button{
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(124,92,255,0.18);
  border: 1px solid rgba(124,92,255,0.34);
  color: var(--text);
}
.nav__button:hover{ text-decoration:none; background: rgba(124,92,255,0.24); }
.nav__form{ margin:0; }
.nav__link--button{
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.hero{
  padding: 26px 0 12px;
}
.hero__title{
  font-size: 30px;
  font-weight: 850;
  letter-spacing: -0.3px;
}
.hero__subtitle{
  margin-top: 8px;
  color: var(--muted);
  max-width: 60ch;
}

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  padding: 12px 0 40px;
}

.card{
  grid-column: span 6;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  overflow:hidden;
  box-shadow: var(--shadow);
  display:flex;
  flex-direction: column;
  min-height: 280px;
}
.card__media{
  height: 150px;
  background: rgba(255,255,255,0.03);
}
.card__media img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}
.card__body{
  padding: 14px 14px 16px;
  display:flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}
.card__meta{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap: wrap;
}
.card__title{
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.2px;
}
.card__preview{
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.card__tags{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.card__actions{ margin-top: auto; }

.pill{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.pill--admin{
  border-color: rgba(124,92,255,0.45);
  color: rgba(220,214,255,0.95);
  background: rgba(124,92,255,0.14);
}
.pill--restricted{
  border-color: rgba(255,77,109,0.45);
  color: rgba(255,199,210,0.95);
  background: rgba(255,77,109,0.12);
}
.tag{
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
}
.muted{ color: var(--muted); }

.button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  text-decoration:none;
}
.button:hover{ text-decoration:none; background: rgba(255,255,255,0.06); }
.button--primary{
  background: linear-gradient(135deg, rgba(124,92,255,0.95), rgba(49,208,170,0.9));
  border-color: rgba(255,255,255,0.14);
}
.button--primary:hover{ filter: brightness(1.05); }

.post{
  padding: 26px 0 40px;
}
.post__header{
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
}
.post__meta{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}
.post__title{
  margin: 10px 0 0;
  font-size: 28px;
  letter-spacing: -0.3px;
}
.post__tags{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.post__media{
  margin-top: 16px;
  border-radius: var(--radius2);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  height: 320px;
}
.post__media img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}
.prose{
  margin-top: 16px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  line-height: 1.7;
}
.prose p{ margin: 0 0 10px; }
.prose__spacer{ height: 12px; }
.prose__list{
  margin: 0 0 10px;
  padding-left: 18px;
  color: var(--muted);
}
.prose code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.9);
}
.prose pre{
  margin: 0 0 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  overflow: auto;
}
.prose pre code{
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  white-space: pre;
}
.callout{
  margin-top: 16px;
  padding: 16px;
  background: rgba(49,208,170,0.08);
  border: 1px solid rgba(49,208,170,0.25);
  border-radius: var(--radius2);
}
.callout__title{ font-weight: 800; margin-bottom: 8px; }
.callout__list{ margin: 0; padding-left: 18px; }
.post__back{ margin-top: 16px; }

.auth{
  padding: 40px 0;
  max-width: 520px;
  margin: 0 auto;
}
.auth__title{
  margin:0;
  font-size: 28px;
  letter-spacing: -0.3px;
}
.auth__subtitle{
  margin: 8px 0 18px;
  color: var(--muted);
}
.auth__form{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  padding: 16px;
  display:flex;
  flex-direction: column;
  gap: 12px;
}
.field{ display:flex; flex-direction: column; gap: 6px; }
.field__label{ color: var(--muted); font-size: 13px; }
.input{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  outline: none;
}
.input:focus{
  border-color: rgba(124,92,255,0.6);
  box-shadow: 0 0 0 4px rgba(124,92,255,0.14);
}
.alert{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,77,109,0.35);
  background: rgba(255,77,109,0.10);
  color: rgba(255,219,226,0.96);
}
.auth__foot{
  margin-top: 14px;
  color: var(--muted);
}

.panel{
  padding: 40px 0;
  max-width: 720px;
  margin: 0 auto;
}
.panel__title{
  margin:0;
  font-size: 26px;
  letter-spacing:-0.3px;
}
.panel__text{
  margin: 10px 0 18px;
  color: var(--muted);
  line-height: 1.6;
}
.panel__actions{ display:flex; gap: 10px; }
.link{ color: rgba(220,214,255,0.95); }
.link:hover{ color: var(--text); }

.footer{
  border-top: 1px solid var(--border);
  background: rgba(11,15,25,0.55);
  padding: 18px 0;
}
.footer__inner{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.gate{
  display:grid;
  place-items:center;
  min-height: 100%;
}
.gate__panel{
  width: min(520px, calc(100% - 32px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.gate__title{
  font-size: 22px;
  font-weight: 900;
  letter-spacing:-0.2px;
}
.gate__text{ margin-top: 8px; color: var(--muted); line-height: 1.5; }
.gate__form{
  margin-top: 14px;
  display:flex;
  gap: 10px;
}
.gate__hint{ margin-top: 12px; }

.is-hidden{ display: none !important; }

.storage__fileButton {
  all: unset;
  cursor: pointer;
  color: rgba(220,214,255,0.95);
}

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

@media (max-width: 900px){
  .card{ grid-column: span 12; }
  .post__media{ height: 240px; }
  .gate__form{ flex-direction: column; }
}
