*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-fallback: #35b2f5;
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --accent-blue: #1a6bb5;
  --accent-blue-deep: #0f4a7a;
  --accent-sky: #5eb3e8;
  --accent-warm: #ff7e67;
  --accent-gold: #f0a830;
  --text-primary: #0f2238;
  --text-muted: #3a5068;
  --border: rgba(43, 127, 212, 0.22);
  --shadow: rgba(26, 58, 92, 0.12);
  --glow-blue: rgba(43, 127, 212, 0.3);
  --online: #16a34a;
  --offline: #dc2626;
  --font-display:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--page-bg-color, var(--bg-fallback));
  background-image: var(
    --page-bg-image,
    linear-gradient(to bottom, #35b2f5, #ffffff)
  );
  background-repeat: var(--page-bg-repeat, no-repeat);
  background-position: var(--page-bg-position, center center);
  background-size: var(--page-bg-size, auto);
  background-attachment: fixed;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 2rem;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 16px var(--shadow);
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
}

.navbar__logo {
  display: block;
  height: 40px;
  width: auto;
}

.navbar__links {
  display: flex;
  gap: 0.25rem;
}

.navbar__link {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition:
    color 0.2s,
    background 0.2s;
}

.navbar__link:hover,
.navbar__link--active {
  color: var(--accent-blue-deep);
  background: rgba(43, 127, 212, 0.12);
}

.navbar__link--icon {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
}

.navbar__icon {
  display: block;
  height: 22px;
  width: auto;
}

/* Layout */
.layout {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  width: 100%;
  max-width: min(1400px, 95vw);
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

.layout--full {
  grid-template-columns: 1fr;
  max-width: min(1200px, 90vw);
}

.content {
  min-width: 0;
  width: 100%;
}

.content__header {
  margin-bottom: 2rem;
}

.content__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  background: linear-gradient(
    135deg,
    var(--accent-blue-deep),
    var(--accent-sky)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.content__subtitle {
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Blog cards */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px var(--shadow);
  transition:
    transform 0.2s,
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
  overflow: hidden;
}

.blog-card--has-image .blog-card__body {
  padding: 1.5rem;
}

.blog-card:not(.blog-card--has-image) {
  padding: 1.5rem;
}

.blog-card__image {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.blog-card:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: rgba(43, 127, 212, 0.4);
  box-shadow: 0 8px 28px var(--shadow);
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.blog-card__tag {
  --tag-color: steelblue;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  color: var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 30%, white);
  border: 1px solid var(--tag-color);
}

.blog-card__date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.blog-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.blog-card__excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.blog-card__read {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s;
}

.blog-card__read:hover {
  color: var(--accent-warm);
}

.blog-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

/* Article (About page) */
.article {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px var(--shadow);
  overflow: hidden;
}

.article__image {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.article__body {
  padding: 2rem;
}

.article__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.article__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.article__text {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.75;
}

.article__text p + p {
  margin-top: 1rem;
}

.article__text h2,
.article__text h3 {
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.article__text ul,
.article__text ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.article__text li + li {
  margin-top: 0.25rem;
}

.article__text a {
  color: var(--accent);
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px var(--shadow);
  position: relative;
  overflow: hidden;
}

.sidebar__card--join {
  border-color: rgba(43, 127, 212, 0.35);
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.92),
    rgba(230, 245, 255, 0.88)
  );
}

.sidebar__sparkle {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-size: 1.5rem;
  color: var(--accent-gold);
  opacity: 0.75;
  animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0.5;
    transform: rotate(0deg) scale(1);
  }
  50% {
    opacity: 1;
    transform: rotate(20deg) scale(1.1);
  }
}

.sidebar__heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.sidebar__text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.btn-join {
  display: block;
  width: 100%;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(
    135deg,
    var(--accent-blue),
    var(--accent-blue-deep)
  );
  box-shadow: 0 4px 20px var(--glow-blue);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.btn-join:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px var(--glow-blue);
}

/* Server status */
.status {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.status__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status__label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.status__badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.status__badge--loading {
  background: rgba(90, 120, 150, 0.12);
  color: var(--text-muted);
}

.status__badge--online {
  background: rgba(22, 163, 74, 0.12);
  color: var(--online);
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.status__badge--offline {
  background: rgba(220, 38, 38, 0.1);
  color: var(--offline);
  border: 1px solid rgba(220, 38, 38, 0.28);
}

.status__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent-blue-deep);
}

.status__updated {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 1;
}

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.45);
}

/* Responsive */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: -1;
  }

  .navbar {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .navbar__links {
    flex-wrap: wrap;
    justify-content: center;
  }
}
