/* =============================================================================
   KNOX HOLD — Project Zomboid Community Template
   Edit :root colours and community details in HTML.
   ============================================================================= */

:root {
  --bg: #0b0a08;
  --bg-2: #12100c;
  --bg-3: #1a1712;
  --surface: rgba(18, 16, 12, 0.82);
  --text: #f2eee6;
  --text-2: #b0a898;
  --text-3: #756c5e;
  --accent: #c4a035;
  --accent-hot: #d4783a;
  --accent-danger: #c4453a;
  --online: #8fd65a;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(196, 160, 53, 0.3);
  --radius: 8px;
  --radius-lg: 14px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --header-h: 72px;
  --container: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { color: #e0c45a; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

ul { list-style: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

h1, h2, h3 {
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #111;
  font-weight: 700;
}

.skip-link:focus { top: 1rem; }

/* Demo banner — remove when deploying for a real community */
.demo-banner {
  position: relative;
  z-index: 300;
  background: #1c1810;
  border-bottom: 1px solid var(--border-strong);
  padding: 0.55rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-2);
}

.demo-banner a {
  font-weight: 700;
  margin-left: 0.35rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: rgba(11, 10, 8, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1rem;
}

.logo {
  display: flex;
  flex-direction: column;
  color: var(--text);
  text-decoration: none;
}

.logo strong {
  font-size: 1.05rem;
  letter-spacing: 0.14em;
}

.logo span {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.nav-list {
  display: flex;
  gap: 0.15rem;
  align-items: center;
}

.nav-link {
  display: block;
  padding: 0.45rem 0.8rem;
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 6px;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  margin: 3px 0;
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; flex-direction: column; }

  .nav {
    position: fixed;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    inset: var(--header-h) 0 0 0;
    background: rgba(11, 10, 8, 0.97);
    padding: 1.25rem;
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    overflow-y: auto;
  }

  .nav.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-link {
    padding: 0.9rem 1rem;
    font-size: 1.1rem;
  }

  .nav-actions {
    flex-direction: column;
    margin-top: 1rem;
  }

  .nav-actions .btn { width: 100%; }
}

body.nav-open { overflow: hidden; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.8rem 1.25rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #12150e;
}

.btn--primary:hover {
  background: #d4b24a;
  color: #12150e;
  box-shadow: 0 0 28px rgba(196, 160, 53, 0.35);
}

.btn--secondary {
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}

.btn--block { width: 100%; }
.btn--sm { padding: 0.55rem 0.9rem; font-size: 0.7rem; }

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  padding: 3rem 0 4rem;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% center;
}

.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 10, 8, 0.92) 0%, rgba(11, 10, 8, 0.7) 45%, rgba(11, 10, 8, 0.45) 70%, rgba(11, 10, 8, 0.75) 100%),
    linear-gradient(180deg, rgba(11, 10, 8, 0.35) 0%, transparent 35%, rgba(11, 10, 8, 0.9) 100%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
  width: 100%;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(196, 160, 53, 0.12);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  text-transform: uppercase;
  margin-bottom: 1rem;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.7);
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--text-2);
  max-width: 460px;
  margin-bottom: 1.75rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 0 0 rgba(125, 207, 106, 0.5);
  animation: pulse 2s ease-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(125, 207, 106, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(125, 207, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(125, 207, 106, 0); }
}

.server-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.server-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.1rem;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.server-card__body { padding: 1.2rem 1.1rem 1.35rem; }

.server-card__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--online);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.server-card__status--inline {
  margin-bottom: 0;
  font-size: 0.7rem;
}

.server-card__map {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.server-card__players {
  font-family: var(--mono);
  color: var(--text-2);
  margin: 0.35rem 0 1rem;
}

.bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.bar > span {
  display: block;
  height: 100%;
  width: 70%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hot));
}

.server-connect {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.server-connect > div {
  padding: 0.7rem 0.85rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.server-connect dt {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.25rem;
}

.server-connect dd {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  word-break: break-all;
}

.server-connect__name {
  font-family: var(--font) !important;
  font-size: 1.1rem !important;
  letter-spacing: 0.02em;
}

.server-card__ip {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-3);
  padding: 0.65rem 0.8rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 1rem;
}

.server-card__meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.server-card__meta dt {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.2rem;
}

.server-card__meta dd {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
}

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero {
    min-height: auto;
    padding: 2rem 0 2.5rem;
  }
  .hero__bg img { object-position: center top; }
  .server-card {
    max-width: 420px;
    margin-inline: auto;
    width: 100%;
  }
}

/* Sections */
.section { padding: 4.5rem 0; }

.section--dark { background: var(--bg-2); }

.section-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

.section-header {
  max-width: 640px;
  margin-bottom: 2.25rem;
}

.section-header h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.section-header p { color: var(--text-2); font-size: 1.05rem; }

.section-header--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Feature strip */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

.feature-tile {
  padding: 1.25rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feature-tile h3 {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.feature-tile p {
  font-size: 0.9rem;
  color: var(--text-2);
}

@media (max-width: 800px) {
  .feature-strip { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .feature-strip { grid-template-columns: 1fr; }
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.gallery__item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 10;
}

.gallery__item--wide {
  grid-column: span 2;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery__item:hover img { transform: scale(1.05); }

.gallery__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.85rem 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 700px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery__item--wide { grid-column: auto; }
}

/* Split feature */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.split__media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 11;
}

.split__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.split__copy h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.split__copy p {
  color: var(--text-2);
  margin-bottom: 1rem;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0 1.5rem;
}

.badge {
  padding: 0.35rem 0.7rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-2);
  background: rgba(0, 0, 0, 0.3);
}

@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; }
}

/* Rules / content pages */
.page-hero {
  position: relative;
  padding: 4rem 0 3rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.page-hero__bg {
  position: absolute;
  inset: 0;
}

.page-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.page-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 10, 8, 0.55), rgba(11, 10, 8, 0.95));
}

.page-hero .container {
  position: relative;
  z-index: 1;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  text-transform: uppercase;
  margin: 0 auto 0.6rem;
}

.page-hero p {
  color: var(--text-2);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.05rem;
}

.content-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.content-card h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
  color: var(--accent);
}

.content-card p,
.content-card li {
  color: var(--text-2);
  font-size: 0.95rem;
}

.content-card ol,
.content-card ul {
  padding-left: 1.2rem;
}

.content-card li {
  list-style: disc;
  margin: 0.35rem 0;
}

.staff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.staff-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  text-align: center;
}

.staff-card__avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a2418, #1a1610);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--accent);
}

.staff-card h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.staff-card p {
  font-size: 0.8rem;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 700px) {
  .staff-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* CTA */
.cta {
  padding: 4rem 0;
}

.cta__inner {
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(196, 160, 53, 0.15), transparent 55%),
    var(--bg-2);
}

.cta__inner h2 {
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.cta__inner p {
  color: var(--text-2);
  margin-bottom: 1.5rem;
}

.cta__inner .btn-group { justify-content: center; }

/* Footer */
.site-footer {
  padding: 3rem 0 1.75rem;
  background: #070605;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-grid p {
  color: var(--text-2);
  font-size: 0.9rem;
  margin-top: 0.65rem;
  max-width: 280px;
}

.footer-col h3 {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.85rem;
}

.footer-col a {
  display: block;
  color: var(--text-2);
  font-size: 0.9rem;
  margin: 0.4rem 0;
}

.footer-col a:hover { color: var(--text); }

.footer-bottom {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-3);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

.footer-credit {
  flex: 1 1 100%;
  margin: 0.5rem 0 0;
  text-align: center;
}

.footer-credit a {
  color: var(--text-3);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.footer-credit a:hover {
  color: var(--accent);
}


@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* =============================================================================
   Mobile hardening
   ============================================================================= */

.nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

html {
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 860px) {
  .nav {
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    inset: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    z-index: 199;
  }

  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .nav-actions .btn {
    min-height: 44px;
  }
}

@media (max-width: 800px) {
  .gallery {
    grid-template-columns: 1fr 1fr;
  }

  .gallery__item--wide {
    grid-column: span 2;
  }

  .staff-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .section {
    padding: 3.25rem 0;
  }

  .page-hero {
    padding: 2.75rem 0 2rem;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .gallery__item--wide {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: clamp(1.85rem, 8vw, 2.4rem);
  }

  .page-hero h1 {
    font-size: clamp(1.65rem, 7vw, 2rem);
  }

  .hero-lead,
  .page-hero p,
  .section-header p {
    font-size: 1rem;
  }

  .server-card {
    max-width: 100%;
  }

  .server-card__meta {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 0.75rem;
  }

  .server-card__meta > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
  }

  .server-card__meta dt {
    margin-bottom: 0;
  }

  .btn {
    white-space: normal;
  }

  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-group .btn {
    width: 100%;
  }

  .logo strong {
    font-size: 0.92rem;
    letter-spacing: 0.08em;
  }

  .container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .cta__inner {
    padding: 2.25rem 1.15rem;
  }

  .content-card {
    padding: 1.15rem;
  }

  .staff-grid {
    grid-template-columns: 1fr;
  }

  .feature-strip {
    grid-template-columns: 1fr;
  }
}
