:root {
  --bg-main: #070506;
  --bg-panel: #11100f;
  --bg-card: #171412;

  --crimson: #9e1018;
  --crimson-bright: #d71920;
  --crimson-dark: #4c0709;

  --gold: #c99a42;
  --gold-bright: #e0bd72;
  --ember: #f15a24;

  --steel: #8b8071;
  --silver: #e7dcc6;

  --text-main: #f4ead8;
  --text-muted: #b7a994;

  --border-soft: rgba(201, 154, 66, 0.35);
  --panel-glass: rgba(10, 8, 8, 0.78);
  --border: var(--border-soft);
  --radius: 10px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

/*
 * Responsive strategy (crp-website public layout)
 * - Containers cap line length for readability on 1366–2560px viewports.
 * - Banner/hero images use clamp() so height scales without growing endlessly.
 * - Card grids use auto-fit + min() so columns wrap cleanly on any width.
 * - Static assets are served under /static (see src/server.js) — paths unchanged here.
 *
 * Responsive rule:
 *   2560x1440 should use the same stable desktop layout as 1440/1920.
 *   Avoid special ultrawide layout shifts.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(158, 16, 24, 0.18), transparent 45%),
    radial-gradient(ellipse at 80% 100%, rgba(201, 154, 66, 0.08), transparent 40%),
    var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
}

a {
  color: var(--gold-bright);
  text-decoration: none;
}

a:hover {
  color: var(--crimson-bright);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.narrow-section {
  width: min(480px, calc(100% - 2rem));
  margin-inline: auto;
}

/* ── Site header ── */

.site-header {
  background: var(--panel-glass);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
}

.brand:hover {
  text-decoration: none;
  color: var(--gold-bright);
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand-mark,
.logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--crimson-dark), var(--crimson));
  border: 1px solid var(--border-soft);
  color: var(--silver);
  font-weight: 700;
  font-size: 0.85rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.site-nav a {
  color: var(--steel);
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
}

.site-nav a.active,
.site-nav a:hover {
  color: var(--gold-bright);
  background: rgba(158, 16, 24, 0.2);
  border: 1px solid transparent;
  text-decoration: none;
}

.site-main {
  min-height: calc(100vh - 140px);
}

/* ── Homepage intro (banner uses .page-banner styles below) ── */

.home-intro {
  display: block;
  margin: 0;
  padding: clamp(2rem, 4vw, 3rem) 0 clamp(2.5rem, 4vw, 3.25rem);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(158, 16, 24, 0.14), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(201, 154, 66, 0.06), transparent 45%);
}

.home-intro__inner {
  display: block;
}

.home-intro__eyebrow {
  margin: 0 0 0.35rem;
}

.home-intro__title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.75rem, 2.5vw, 2.5rem);
  color: var(--silver);
}

.home-intro__lead {
  margin: 0 0 1.25rem;
  max-width: 62ch;
  color: var(--text-main);
}

.home-intro .hero-actions {
  margin-top: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Page banners (servers, support, rules, knowledge) ── */

.page-banner {
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-panel);
}

.page-banner img,
.servers-banner img,
.support-banner img {
  width: 100%;
  max-width: 100%;
  height: clamp(140px, 18vw, 300px);
  object-fit: cover;
  object-position: center;
}

.servers-banner img {
  object-position: center 40%;
}

.support-banner img {
  object-position: center 35%;
}

/* Home hero: full 1920×360 art, capped height — no crop on desktop, no ultrawide stretch */
.home-banner.page-banner {
  line-height: 0;
  background: var(--bg-main);
  border-bottom: none;
}

.home-banner img {
  display: block;
  width: 100%;
  height: clamp(160px, 18.75vw, 360px);
  object-fit: contain;
  object-position: center;
}

.banner-caption {
  padding: 0.5rem 0;
  color: var(--gold);
  font-size: 0.9rem;
  text-align: center;
}

/* ── Footer ── */

.site-footer {
  position: relative;
  margin-top: 3rem;
  border-top: 1px solid var(--border-soft);
  background-color: var(--bg-panel);
  background-image: linear-gradient(
    180deg,
    rgba(7, 5, 6, 0.96) 0%,
    rgba(17, 16, 15, 0.94) 100%
  );
}

.site-footer--has-bg {
  background-image:
    linear-gradient(
      180deg,
      rgba(7, 5, 6, 0.94) 0%,
      rgba(17, 16, 15, 0.9) 45%,
      rgba(7, 5, 6, 0.96) 100%
    ),
    var(--footer-bg);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(1.25rem, 2vw, 2rem);
  align-items: start;
  padding: clamp(2rem, 3vw, 2.5rem) 0 clamp(1.25rem, 2vw, 1.5rem);
}

.site-footer__brand {
  display: flex;
  justify-content: center;
}

.site-footer__logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.site-footer__logo--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gold-bright);
  background: rgba(158, 16, 24, 0.25);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.site-footer__slogan {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-width: 260px;
  min-width: 0;
}

.site-footer__slogan-line {
  display: block;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
  overflow-wrap: break-word;
}

.site-footer__section {
  min-width: 0;
}

.site-footer__title {
  margin: 0 0 0.65rem;
  color: var(--gold-bright);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.site-footer__links a {
  color: var(--silver);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer__links a:hover {
  color: var(--gold-bright);
  text-decoration: none;
}

.site-footer__partof {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.5rem 0;
}

.site-footer__partof-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-footer__partof-code {
  color: var(--gold-bright);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.06em;
}

.site-footer__partof-name {
  color: var(--silver);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  max-width: 12rem;
  overflow-wrap: break-word;
}

.site-footer__copyright {
  border-top: 1px solid var(--border-soft);
  padding: 1rem 0 1.75rem;
  text-align: center;
}

.site-footer__copyright p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Hero typography & actions (homepage + shared) ── */

.eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  margin: 0 0 0.25rem;
}

.tagline {
  color: var(--gold-bright);
  font-size: 1.05rem;
  font-weight: 600;
  font-style: italic;
  margin: 0.25rem 0 0.75rem;
  letter-spacing: 0.02em;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0 0 0.75rem;
  color: var(--silver);
}

h1 {
  font-size: clamp(2rem, 3vw, 3.25rem);
}

h2 {
  color: var(--gold-bright);
  font-size: clamp(1.5rem, 2vw, 2.2rem);
}

.lead {
  color: var(--silver);
  max-width: 60ch;
  font-size: clamp(1rem, 1.1vw, 1.15rem);
}

.section {
  padding: clamp(2.5rem, 4vw, 4rem) 0;
}

.page-head {
  padding-top: 1.5rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* ── Cards ── */

.card {
  background: var(--panel-glass);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: stretch;
}

.server-card .card-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 0.75rem;
}

.server-card:hover {
  border-color: var(--gold);
}

.meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(158, 16, 24, 0.25);
  border: 1px solid rgba(215, 25, 32, 0.35);
  color: var(--crimson-bright);
  font-size: 0.8rem;
  font-weight: 600;
}

.pill-muted {
  background: rgba(139, 128, 113, 0.2);
  border-color: rgba(139, 128, 113, 0.35);
  color: var(--steel);
}

.pill-code {
  background: rgba(201, 154, 66, 0.18);
  border-color: rgba(201, 154, 66, 0.45);
  color: var(--gold-bright);
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--crimson);
  color: #fff;
  border-color: var(--crimson-dark);
}

.btn-primary:hover {
  background: var(--crimson-bright);
  border-color: var(--gold);
  color: #fff;
  box-shadow: 0 0 0 1px var(--gold-bright);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-soft);
  color: var(--silver);
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(201, 154, 66, 0.08);
}

.btn-ghost {
  background: transparent;
  color: var(--steel);
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--gold-bright);
  border-color: var(--border-soft);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.text-link {
  color: var(--gold);
  font-weight: 600;
}

.text-link:hover {
  color: var(--gold-bright);
}

.support-preview-inner,
.support-intro {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.support-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.rules-list,
.steps-list {
  padding-left: 1.25rem;
}

.rules-list li,
.steps-list li {
  margin-bottom: 0.5rem;
}

.filter-bar {
  margin-bottom: 1rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--steel);
  min-width: 140px;
}

input,
select,
textarea {
  background: rgba(17, 16, 15, 0.9);
  border: 1px solid var(--border-soft);
  color: var(--text-main);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 154, 66, 0.2);
}

textarea {
  resize: vertical;
}

.checkbox-label {
  flex-direction: row;
  align-items: center;
}

.article-list {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

.article-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.excerpt {
  color: var(--text-muted);
}

.article-body {
  white-space: pre-wrap;
}

.article-keywords {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.flash-messages {
  padding: 0.75rem 0;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.flash-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.flash-error {
  background: rgba(215, 25, 32, 0.15);
  border: 1px solid rgba(215, 25, 32, 0.4);
}

.flash-info {
  background: rgba(201, 154, 66, 0.12);
  border: 1px solid var(--border-soft);
}

.alert {
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
}

.alert-warning {
  background: rgba(241, 90, 36, 0.12);
  border-color: rgba(241, 90, 36, 0.35);
}

.alert-error {
  background: rgba(215, 25, 32, 0.12);
}

.alert-info {
  background: rgba(139, 128, 113, 0.12);
}

.muted {
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
}

/* ── Admin login ── */

.page-login.admin-login-bg .site-main {
  position: relative;
  min-height: calc(100vh - 120px);
  background:
    linear-gradient(rgba(7, 5, 6, 0.55), rgba(7, 5, 6, 0.75)),
    url("/static/assets/banners/crp-admin-login-bg.png") center / cover no-repeat;
}

.page-login .auth-section {
  margin: 0 auto;
  padding: 3rem 0;
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-login .auth-panel {
  width: 100%;
  background: var(--panel-glass);
  border: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.auth-card {
  display: grid;
  gap: 1.25rem;
}

.auth-brand {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.auth-logo {
  width: 56px;
  height: 56px;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.oauth-placeholder {
  border-top: 1px solid var(--border-soft);
  padding-top: 1rem;
}

.oauth-primary,
.oauth-unavailable,
.oauth-fallback {
  display: grid;
  gap: 0.85rem;
}

.oauth-help {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.oauth-fallback {
  border-top: 1px solid var(--border-soft);
  padding-top: 1rem;
  margin-top: 0.25rem;
}

.oauth-fallback-label {
  margin: 0;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn-discord {
  background: #5865f2;
  border: 1px solid #4752c4;
  color: #fff;
}

.btn-discord:hover {
  background: #4752c4;
  color: #fff;
  text-decoration: none;
}

.oauth-callback-note code {
  word-break: break-all;
}

code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.85em;
  background: rgba(17, 16, 15, 0.9);
  border: 1px solid var(--border-soft);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* ── Responsive breakpoints ── */

/* Large desktop (1440px+) — same stable layout as 1920/2560 */
@media (min-width: 1440px) {
  .container {
    width: min(1180px, calc(100% - 4rem));
  }
}

/* Tablet (1024px and below) */
@media (max-width: 1024px) {
  .header-inner {
    gap: 0.75rem;
  }

  .site-nav {
    gap: 0.35rem 0.75rem;
  }

  .site-footer__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem 2rem;
  }

  .site-footer__brand,
  .site-footer__partof {
    grid-column: 1 / -1;
  }

  .site-footer__slogan {
    max-width: none;
  }
}

/* Mobile (720px and below) */
@media (max-width: 720px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .support-preview-inner,
  .support-intro {
    flex-direction: column;
  }

  .home-intro {
    padding-top: 1.75rem;
    padding-bottom: 2rem;
  }

  .page-banner img,
  .servers-banner img,
  .support-banner img {
    height: clamp(120px, 28vw, 200px);
  }

  .home-banner img {
    height: clamp(140px, 47vw, 260px);
    object-fit: contain;
    object-position: center;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
    padding: 2rem 0 1.25rem;
  }

  .site-footer__brand,
  .site-footer__partof {
    grid-column: auto;
  }

  .site-footer__slogan {
    align-items: center;
    margin-inline: auto;
  }

  .site-footer__section {
    text-align: center;
  }

  .site-footer__links {
    align-items: center;
  }
}
