/* Server features — Overview Rail (frameless, distinct from Events Altar) */

#about-preview .container {
  width: min(100% - var(--space-6), 1280px);
}

#about-preview .server-heading {
  text-align: center;
  max-width: 760px;
  margin: 0 auto clamp(28px, 4vw, 48px);
}

#about-preview .server-heading__eyebrow {
  display: inline-flex;
  margin: 0 0 var(--space-3);
  color: var(--color-accent-soft);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#about-preview .server-heading .section-title {
  margin-bottom: var(--space-4);
}

#about-preview .server-heading__subtitle {
  max-width: 620px;
  margin: 0 auto;
  color: var(--color-text-secondary);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

/* Rail root — no full perimeter frame */
.server-codex {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 36px) 0 clamp(28px, 4vw, 40px);
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.server-codex__topline,
.server-codex__footline {
  display: block;
  height: 1px;
  margin-inline: auto;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(233, 193, 86, 0.32),
    transparent
  );
  pointer-events: none;
}

.server-codex__topline {
  width: min(100%, 720px);
  margin-bottom: clamp(var(--space-6), 4vw, var(--space-8));
}

.server-codex__footline {
  width: min(100%, 880px);
  margin-top: clamp(var(--space-8), 4vw, var(--space-10));
  opacity: 0.45;
}

/* Tabs — light pills, centered */
.server-codex__tabs {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  padding: 0;
}

.server-codex__tab {
  position: relative;
  padding: 0.55rem 1.1rem;
  border: 1px solid rgba(233, 193, 86, 0.18);
  border-radius: 999px;
  background: rgba(16, 15, 13, 0.35);
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    background 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out),
    transform 220ms var(--ease-out);
}

.server-codex__tab:hover {
  color: var(--color-accent-soft);
  border-color: rgba(233, 193, 86, 0.36);
  background: rgba(245, 162, 15, 0.06);
  box-shadow: 0 0 14px rgba(245, 162, 15, 0.1);
}

.server-codex__tab.is-active {
  color: var(--color-text);
  border-color: rgba(233, 193, 86, 0.48);
  background: rgba(245, 162, 15, 0.1);
  box-shadow:
    0 0 22px rgba(245, 162, 15, 0.16),
    inset 0 1px 0 rgba(255, 220, 140, 0.08);
  transform: translateY(-1px);
}

.server-codex__tab.is-active::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: -4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  box-shadow: 0 0 8px rgba(245, 162, 15, 0.45);
}

.server-codex__tab:focus-visible {
  outline: 2px solid var(--color-accent-soft);
  outline-offset: 3px;
}

/* Body — landscape grid + compact beacon */
.server-codex__body {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(168px, 220px);
  align-items: start;
  gap: clamp(20px, 3vw, 40px);
}

.server-codex__panels {
  position: relative;
  min-width: 0;
  min-height: var(--server-panel-min-height, auto);
}

@media (min-width: 768px) {
  .server-codex__body {
    align-items: stretch;
  }

  .server-codex__beacon {
    align-self: start;
  }
}

.server-codex__body.is-switching .server-codex__panel.is-active {
  opacity: 0.35;
  transform: translateY(6px);
  transition:
    opacity 220ms var(--ease-out),
    transform 220ms var(--ease-out);
}

.server-codex__body.is-switching .server-codex__beacon {
  opacity: 0.5;
  transform: translateY(4px);
}

.server-codex__panel {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.server-codex__panel.is-active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* Wide feature layout */
.server-codex__layout {
  display: grid;
  gap: clamp(var(--space-3), 2vw, var(--space-5));
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 900px) {
  .server-codex__layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .server-feature--wide {
    grid-column: 1 / -1;
  }
}

/* Feature panels — local borders only */
.server-feature {
  position: relative;
  padding: 18px 20px;
  border: 1px solid rgba(233, 193, 86, 0.2);
  border-radius: 18px;
  background: rgba(16, 15, 13, 0.48);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    transform 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out),
    background 220ms var(--ease-out);
}

.server-feature__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.server-feature::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(245, 162, 15, 0.08) 48%,
    rgba(245, 162, 15, 0.14) 50%,
    rgba(245, 162, 15, 0.08) 52%,
    transparent 60%
  );
  transition: opacity 320ms var(--ease-out);
  pointer-events: none;
}

.server-feature:hover,
.server-feature:focus-within {
  transform: translateY(-3px);
  border-color: rgba(233, 193, 86, 0.46);
  box-shadow:
    0 0 28px rgba(245, 162, 15, 0.14),
    0 14px 36px rgba(0, 0, 0, 0.28);
  background: rgba(20, 16, 12, 0.72);
}

.server-feature:hover::after,
.server-feature:focus-within::after {
  opacity: 1;
}

.server-feature__title {
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: normal;
  line-height: 1.25;
  color: var(--color-accent-soft);
  overflow-wrap: anywhere;
}

.server-feature__tag {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  max-width: 100%;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  border: 1px solid rgba(233, 193, 86, 0.22);
  background: rgba(245, 162, 15, 0.08);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-soft);
  white-space: nowrap;
}

.server-feature__text {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--color-text-secondary);
}

/* Staggered panel entrance */
.server-codex__panel.is-active .server-feature {
  animation: serverFeatureIn 420ms var(--ease-out) both;
}

.server-codex__panel.is-active .server-feature:nth-child(1) {
  animation-delay: 0ms;
}

.server-codex__panel.is-active .server-feature:nth-child(2) {
  animation-delay: 70ms;
}

.server-codex__panel.is-active .server-feature:nth-child(3) {
  animation-delay: 140ms;
}

@keyframes serverFeatureIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Compact stat beacon — HUD, not altar circle */
.server-codex__beacon {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  min-width: 168px;
  border: 1px solid rgba(233, 193, 86, 0.24);
  border-radius: 16px;
  background:
    linear-gradient(160deg, rgba(245, 162, 15, 0.1), transparent 55%),
    rgba(16, 15, 13, 0.55);
  box-shadow: 0 0 24px rgba(245, 162, 15, 0.08);
  transition:
    opacity 260ms var(--ease-out),
    transform 260ms var(--ease-out),
    border-color 260ms var(--ease-out);
}

.server-codex__beacon::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233, 193, 86, 0.5), transparent);
}

.server-codex__beacon-kicker {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  transition: opacity 260ms var(--ease-out);
}

.server-codex__beacon-value {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  line-height: 1.1;
  color: var(--color-accent);
  text-shadow: 0 0 20px rgba(245, 162, 15, 0.28);
  transition:
    opacity 260ms var(--ease-out),
    transform 260ms var(--ease-out);
}

.server-codex__body.is-switching .server-codex__beacon-value {
  opacity: 0.45;
  transform: scale(0.96);
}

@media (max-width: 899px) {
  .server-codex__body {
    grid-template-columns: 1fr;
  }

  .server-codex__beacon {
    order: -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    min-width: 0;
  }

  .server-codex__beacon-value {
    font-size: var(--text-xl);
  }
}

@media (max-width: 767px) {
  #about-preview .server-heading {
    margin-bottom: var(--space-6);
  }

  .server-codex {
    padding-inline: 0;
  }

  .server-codex__tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    margin-inline: -2px;
    padding-inline: 2px 12px;
  }

  .server-codex__tabs::-webkit-scrollbar {
    display: none;
  }

  .server-codex__tab {
    flex: 0 0 auto;
    scroll-snap-align: center;
  }

  .server-codex__layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .server-feature__head {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .server-codex * {
    animation: none !important;
    transition-duration: 1ms !important;
  }

  .server-codex__panel.is-active .server-feature {
    opacity: 1;
    transform: none;
  }
}
