/* ==========================================================================
   Veltrix SMP Bulletin — Core Design System
   Base tokens, reset, typography, layout primitives, shared components.
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Colors */
  --color-bg: #FAFAF8;
  --color-bg-alt: #F3F3EF;
  --color-card: #FFFFFF;
  --color-accent: #6BA539;
  --color-accent-dark: #598c2d;
  --color-accent-soft: #93C45B;
  --color-text: #202020;
  --color-muted: #707070;
  --color-border: #ECECEC;
  --color-overlay: rgba(255, 255, 255, 0.72);

  /* Typography */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;

  /* Spacing scale (Apple-esque generous rhythm) */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 7rem;

  /* Radii & shadows */
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --shadow-soft: 0 2px 8px rgba(20, 20, 20, 0.04), 0 1px 2px rgba(20, 20, 20, 0.03);
  --shadow-mid: 0 12px 32px rgba(20, 20, 20, 0.08), 0 2px 8px rgba(20, 20, 20, 0.04);
  --shadow-lift: 0 28px 60px rgba(20, 20, 20, 0.14), 0 8px 20px rgba(20, 20, 20, 0.06);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.22s;
  --dur-med: 0.45s;
  --dur-slow: 0.8s;

  /* Layout */
  --container: 1240px;
  --header-h: 84px;
}

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

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

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

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

/* ---------- Focus / Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-accent);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 999;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

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

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
  line-height: 1.1;
  font-weight: 700;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.text-muted {
  color: var(--color-muted);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

main {
  display: block;
}

section {
  position: relative;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.7rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  will-change: transform;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(155deg, var(--color-accent-soft), var(--color-accent));
  color: #fff;
  box-shadow: 0 8px 20px rgba(107, 165, 57, 0.32);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(107, 165, 57, 0.4);
}

.btn-secondary {
  background: var(--color-overlay);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--color-text);
  border: 1px solid rgba(32, 32, 32, 0.08);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: #fff;
  box-shadow: var(--shadow-mid);
}

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

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

.btn .icon {
  width: 1.05em;
  height: 1.05em;
  transition: transform var(--dur-fast) var(--ease-out);
}

.btn:hover .icon {
  transform: translateX(3px);
}

/* Ripple effect */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
  animation: ripple 650ms var(--ease-out);
}

@keyframes ripple {
  to {
    transform: scale(3.2);
    opacity: 0;
  }
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: #fff;
  color: var(--color-accent-dark);
  box-shadow: var(--shadow-soft);
}

.badge-featured {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: #fff;
  box-shadow: 0 8px 18px rgba(107, 165, 57, 0.35);
}

.badge-category {
  background: rgba(107, 165, 57, 0.12);
  color: var(--color-accent-dark);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out), height var(--dur-med) var(--ease-out), backdrop-filter var(--dur-med) var(--ease-out);
  background: transparent;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Translucent frosted glass — always present so the bar reads as a real,
     premium top bar and content flows cleanly beneath it. */
  background: rgba(250, 250, 248, 0.68);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid rgba(20, 20, 20, 0.05);
  transition: background var(--dur-med) var(--ease-out);
  z-index: -1;
}

.site-header.is-scrolled {
  height: calc(var(--header-h) - 12px);
  box-shadow: 0 1px 0 rgba(20, 20, 20, 0.04), 0 12px 30px rgba(20, 20, 20, 0.06);
}

.site-header.is-scrolled::before {
  background: rgba(250, 250, 248, 0.82);
}

.header-inner {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform var(--dur-fast) var(--ease-spring);
}

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

.brand:hover .brand-mark {
  transform: rotate(-8deg) scale(1.06);
}

.brand-name {
  font-size: 1.12rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-name span {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.42em;
  color: var(--color-accent);
  font-family: var(--font-body);
  font-weight: 700;
  margin-top: 3px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.main-nav a {
  position: relative;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text);
  padding-block: 0.4rem;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--dur-fast) var(--ease-out);
}

.main-nav a:hover::after,
.main-nav a.is-active::after {
  width: 100%;
}

.main-nav a.is-active {
  color: var(--color-accent-dark);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 20px;
  height: 20px;
  color: var(--color-muted);
  transition: color var(--dur-fast);
}

.search-trigger:hover {
  color: var(--color-accent-dark);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
  margin-inline: auto;
}

.hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.is-open span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav overlay */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-spring), transform var(--dur-med) var(--ease-spring);
}

.mobile-nav.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-nav ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.mobile-nav ul a {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.mobile-nav ul a:hover,
.mobile-nav ul a:active {
  color: var(--color-accent-dark);
  transform: scale(1.04);
}

/* Discord CTA inside the mobile menu */
.mobile-nav .mobile-discord {
  margin-top: var(--space-2);
  font-size: 1.02rem;
  padding: 1rem 2.4rem;
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  color: #fff;
  padding-top: calc(var(--space-7) + 8px);
  background-size: cover;
  background-position: center;
  isolation: isolate;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 26, 14, 0.58) 0%, rgba(14, 18, 10, 0.88) 60%, rgba(10, 13, 7, 0.97) 100%);
  z-index: -1;
}

/* Playful Grass Border Edge */
.footer-grass-border {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: #6BA539;
  border-bottom: 4px solid #8B5A2B;
  box-shadow: 0 4px 14px rgba(107, 165, 57, 0.22);
  z-index: 2;
}

.footer-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--space-5) var(--space-4) var(--space-5);
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.8fr 1fr;
  gap: var(--space-5);
}

.footer-brand .brand-mark {
  box-shadow: none;
}

.footer-brand .brand-name {
  color: #fff;
}

.footer-brand .brand-name span {
  color: var(--color-accent-soft);
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.72);
  margin-top: var(--space-2);
  max-width: 32ch;
  font-size: 0.94rem;
  line-height: 1.5;
}

/* Status Badge inside Brand block */
.footer-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  margin-top: var(--space-3);
  width: fit-content;
  backdrop-filter: blur(8px);
}

.status-pulse-dot {
  width: 10px;
  height: 10px;
  background: #10B981;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 12px #10B981;
}

.status-pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #10B981;
  animation: status-ping 1.8s infinite ease-out;
  opacity: 0.8;
}

@keyframes status-ping {
  0% {
    transform: scale(0.6);
    opacity: 1;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.status-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.status-title {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.status-players {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: var(--space-2);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.94rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color var(--dur-fast), transform var(--dur-fast);
}

.footer-col a:hover {
  color: var(--color-accent-soft);
  transform: translateX(3px);
}

/* Playful custom bullets for Faction links */
.faction-link span {
  font-size: 0.8rem;
  transition: transform var(--dur-fast) var(--ease-out);
}

.faction-link.crimson:hover {
  color: #E11D48 !important;
}

.faction-link.obsidian:hover {
  color: #8B5CF6 !important;
}

.faction-link.aether:hover {
  color: #06B6D4 !important;
}

.faction-link:hover span {
  transform: scale(1.2) rotate(15deg);
  display: inline-block;
}

/* Brand colored social links on hover */
.footer-social-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: color var(--dur-fast), transform var(--dur-fast);
  color: rgba(255, 255, 255, 0.85);
}

.social-link svg {
  transition: transform var(--dur-fast);
}

.social-link:hover svg {
  transform: scale(1.15) rotate(-5deg);
}

.social-link.discord:hover {
  color: #5865F2 !important;
}

.social-link.youtube:hover {
  color: #FF0000 !important;
}

.social-link.instagram:hover {
  color: #E1306C !important;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container);
  margin-inline: auto;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Modern Copy IP pill button */
.footer-ip-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.footer-ip-copy .ip-address {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.footer-ip-copy .ip-copy-btn {
  color: var(--color-accent-soft);
  background: transparent;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--dur-fast);
  padding: 0.1rem 0.4rem;
}

.footer-ip-copy .ip-copy-btn:hover {
  transform: scale(1.06);
  color: #fff;
}

@media (max-width: 992px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }
}

@media (max-width: 576px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: var(--space-3);
  bottom: var(--space-3);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
  z-index: 60;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-3px) scale(1.05);
}

/* ---------- Loading screen ---------- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-block {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(155deg, var(--color-accent-soft), var(--color-accent));
  animation: loader-spin 1.1s var(--ease-spring) infinite;
  box-shadow: var(--shadow-mid);
}

@keyframes loader-spin {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(0.85); }
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-accent-soft), var(--color-accent));
  z-index: 101;
  transition: width 0.1s linear;
}

/* ---------- Skeletons ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #eee;
  border-radius: var(--radius-md);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: translateX(-100%);
  animation: skeleton-sheen 1.4s infinite;
}

@keyframes skeleton-sheen {
  100% { transform: translateX(100%); }
}

/* ---------- 404 ---------- */
.error-page {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6) var(--space-3);
}

.error-page h1 {
  font-size: clamp(4rem, 14vw, 9rem);
  color: var(--color-accent);
  line-height: 1;
}

.error-page p {
  color: var(--color-muted);
  margin: var(--space-2) 0 var(--space-4);
  font-size: 1.1rem;
}
