:root {
  color-scheme: dark;
  --background: #07070c;
  --panel: #100f1b;
  --line: #32345a;
  --gold: #79a1e2;
  --text: #dfe5f2;
  --muted: #9ea4c0;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at top, #18153a 0, #0c0b19 38%, var(--background) 78%);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
textarea {
  font: inherit;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #5b7ec4;
  border-radius: 4px;
  padding: 10px 18px;
  background: linear-gradient(#3c33a2, #211b4f);
  color: #e1edff;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.button:hover {
  filter: brightness(1.15);
  text-decoration: none;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #85a8e6;
  outline-offset: 4px;
}

.secondary {
  border-color: #454c77;
  background: linear-gradient(#1f1f38, #100f1b);
  font-weight: 500;
}

.site-header {
  max-width: 1180px;
  margin: auto;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid #475780;
}

.brand-text {
  color: #bbd3f5;
  font: bold 23px/1.15 Georgia, serif;
  letter-spacing: 1.5px;
  text-shadow: 0 2px 10px #000;
}

.brand-text span {
  display: block;
  color: var(--gold);
  font: bold 10px/1.6 system-ui, sans-serif;
  letter-spacing: 4px;
}

.site-header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
}

.site-header nav form {
  margin: 0;
}

.public-main,
.admin-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 28px 70px;
}

.hero {
  margin-bottom: 28px;
  padding: 54px 36px;
  border: 1px solid #414b76;
  border-radius: 5px;
  background: linear-gradient(110deg, #0c0b1b, #171535 55%, #0b0a12);
  box-shadow: 0 18px 60px #0008;
}

.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 1.7px;
}

h1,
h2,
h3 {
  margin: 12px 0 18px;
  line-height: 1.25;
}

h1 {
  color: #bbd3f5;
  font: 40px/1.2 Georgia, serif;
}

h2 {
  color: #b4cbf0;
  font-size: 23px;
}

h3 {
  font-size: 18px;
}

p {
  margin: 10px 0;
  color: var(--muted);
}

time {
  color: var(--muted);
  font-size: 13px;
}

.news-list {
  max-width: 930px;
  margin: auto;
}

.news-card,
.card,
.auth-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: linear-gradient(145deg, #131224, #090810);
  box-shadow: 0 12px 40px #0007;
}

.news-card {
  margin-bottom: 22px;
  border-top: 2px solid #526ca8;
}

.post-body {
  color: #cbd1e0;
  overflow-wrap: anywhere;
}

.auth-card {
  max-width: 520px;
  margin: 14px auto 40px;
  padding: 34px;
}

.auth-card h1 {
  font-size: 32px;
}

.auth-card form > button {
  width: 100%;
  margin-top: 22px;
}

label {
  display: block;
  margin: 18px 0 7px;
  color: #c2d1ea;
  font-size: 14px;
  font-weight: 650;
}

input,
textarea {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #464c74;
  border-radius: 4px;
  outline: none;
  background: #07070b;
  color: var(--text);
}

input:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px #d7a75624;
}

textarea {
  min-height: 200px;
  resize: vertical;
}

small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.captcha-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.captcha-row img {
  max-width: 100%;
  height: 74px;
  border: 1px solid #464c74;
  border-radius: 4px;
}

.captcha-row button {
  padding: 8px 10px;
  font-size: 12px;
}

.notice {
  margin: 18px 0;
  padding: 13px 17px;
  border: 1px solid #736bbc;
  border-radius: 4px;
  background: #62261d55;
  color: #dfdeff;
}

.notice.success {
  border-color: #65875b;
  background: #193d2d;
  color: #d9f6e8;
}

.dashboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-heading h1 {
  font-size: 35px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  font-weight: 500;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: #577bcb;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.count {
  color: var(--muted);
  font-size: 15px;
}

.admin-post {
  padding: 19px 0;
  border-bottom: 1px solid #2d2f49;
  overflow-wrap: anywhere;
}

.admin-post:first-child {
  padding-top: 4px;
}

.admin-post h3 {
  margin: 9px 0;
}

.status {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid #525b78;
  border-radius: 20px;
  color: #b3bcd2;
  font-size: 11px;
}

.status.live {
  border-color: #65875b;
  color: #c7e9b8;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
  font-size: 13px;
}

.post-actions form {
  margin: 0;
}

.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: #8ca8d1;
  font-size: 13px;
  font-weight: 500;
}

.empty {
  padding: 20px 0;
}

.empty h2 {
  color: #b3c8e8;
}

#publish-math-captcha[hidden] {
  display: none;
}

footer {
  padding: 22px;
  border-top: 1px solid #1d1f36;
  color: #868fa8;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 760px) {
  .site-header {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }

  .site-header nav {
    justify-content: center;
    gap: 18px;
    font-size: 14px;
  }

  .public-main,
  .admin-main {
    padding: 24px 16px 45px;
  }

  .hero {
    padding: 36px 24px;
  }

  h1 {
    font-size: 32px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-card {
    padding: 24px;
  }

  .card,
  .news-card {
    padding: 22px;
  }
}

.brand-text img { display:block; object-fit:contain; }
