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

:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --grey-100: #f5f5f5;
  --grey-300: #d4d4d4;
  --grey-400: #a3a3a3;
  --grey-500: #737373;
  --grey-600: #525252;
  --grey-800: #262626;
  --red: #dc2626;
  --red-light: #ef4444;
  --red-dark: #991b1b;
  --red-dim: rgba(220, 38, 38, 0.12);
  --border: rgba(255, 255, 255, 0.08);
  --border-red: rgba(220, 38, 38, 0.35);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  --font: "Inter", system-ui, sans-serif;
  --font-display: "Bebas Neue", Impact, sans-serif;
}

html { scroll-behavior: smooth; }

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

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(153, 27, 27, 0.35), transparent 70%),
    radial-gradient(ellipse 80% 50% at 50% 100%, #000, transparent);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
}

/* Brand text Rex + SMP */
.brand-rex, .title-rex { color: var(--red-light); }
.brand-smp, .title-smp { color: var(--grey-300); }

.brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.nav-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.35));
}

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

.nav-links a {
  color: var(--grey-400);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--grey-100); }

.nav-discord {
  color: var(--grey-100) !important;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border-red);
  border-radius: 999px;
  background: var(--red-dim);
}

.nav-discord:hover {
  background: rgba(220, 38, 38, 0.22);
  color: #fff !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--grey-300);
  border-radius: 2px;
}

.nav.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem 1.5rem 4rem;
}

.hero-logo {
  width: min(280px, 72vw);
  height: auto;
  margin-bottom: 1.25rem;
  object-fit: contain;
  filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 60px rgba(220, 38, 38, 0.2));
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--grey-500);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}

.ip-card {
  width: min(520px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border-red);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 1.75rem;
}

.ip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.ip-divider {
  height: 1px;
  background: var(--border);
}

.ip-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--grey-500);
  margin-bottom: 0.3rem;
}

.ip-value {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: clamp(0.78rem, 2.5vw, 0.9rem);
  color: var(--grey-300);
  word-break: break-all;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.5rem 0.9rem;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--grey-100);
  background: var(--grey-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.copy-btn:hover {
  background: var(--red-dark);
  border-color: var(--red);
}

.copy-btn-block {
  width: 100%;
  justify-content: center;
  margin-top: 1.25rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.6rem;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}

.btn-primary {
  color: #fff;
  background: var(--red);
  border: 1px solid var(--red-light);
}

.btn-primary:hover {
  background: var(--red-light);
  transform: translateY(-1px);
}

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

.btn-ghost:hover {
  border-color: var(--grey-400);
  color: var(--grey-100);
}

.btn-lg { padding: 0.95rem 1.75rem; font-size: 0.95rem; }

.btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--grey-800);
  color: var(--grey-500);
  border: 1px solid var(--border);
}

.scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  color: var(--grey-600);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Sections */
.section {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
}

.section-alt {
  background: var(--grey-800);
  background: linear-gradient(180deg, rgba(38, 38, 38, 0.4), rgba(10, 10, 10, 0));
  max-width: none;
  padding-left: max(1.5rem, calc((100% - 1100px) / 2));
  padding-right: max(1.5rem, calc((100% - 1100px) / 2));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: 0.08em;
  color: var(--grey-100);
  margin-bottom: 0.4rem;
}

.section-head h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--red);
  margin: 0.5rem auto 0;
}

.section-head p {
  color: var(--grey-500);
  font-size: 0.95rem;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  transition: background 0.2s, border-color 0.2s;
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-red);
}

.stat-live { border-left-color: var(--red-light); }

.stat-icon {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grey-800);
  border-radius: 10px;
}

.online-dot {
  background: var(--red-dim);
}

.online-dot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red-light);
  box-shadow: 0 0 10px var(--red);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.stat-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--grey-100);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--grey-500);
}

.stat-status {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--grey-500);
}

.stat-status.online { color: var(--red-light); }
.stat-status.offline { color: var(--red); }

/* Join */
.join-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}

.join-card {
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.join-platform {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--red-light);
  margin-bottom: 1rem;
  padding: 0.25rem 0.65rem;
  background: var(--red-dim);
  border: 1px solid var(--border-red);
  border-radius: 999px;
}

.join-platform.bedrock {
  color: var(--grey-300);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

.join-steps { list-style: none; counter-reset: step; }

.join-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.75rem;
  color: var(--grey-400);
  font-size: 0.9rem;
}

.join-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  border-radius: 50%;
}

.join-steps code {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
  color: var(--grey-300);
  background: var(--grey-800);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.feature-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, background 0.2s;
}

.feature-card:hover {
  border-color: var(--border-red);
  background: var(--bg-card-hover);
}

.feature-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.65rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--grey-100);
  margin-bottom: 0.4rem;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--grey-500);
  line-height: 1.55;
}

.feature-card code {
  font-family: ui-monospace, monospace;
  font-size: 0.88em;
  color: var(--red-light);
}

/* Commands */
.commands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.command-group {
  padding: 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.command-group h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--red-light);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.command-group ul { list-style: none; }

.command-group li {
  font-size: 0.85rem;
  color: var(--grey-400);
  margin-bottom: 0.4rem;
}

.command-group code {
  font-family: ui-monospace, monospace;
  font-size: 0.86em;
  color: var(--grey-300);
}

/* Store */
.store-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.store-card {
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.store-featured {
  border-color: var(--border-red);
  background: linear-gradient(160deg, var(--red-dim), var(--bg-card));
}

.store-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grey-500);
  margin-bottom: 0.65rem;
}

.store-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--grey-100);
  margin-bottom: 0.85rem;
}

.store-perks {
  list-style: none;
  flex: 1;
  margin-bottom: 1.25rem;
}

.store-perks li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--grey-400);
}

.store-perks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
}

.store-note {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--grey-500);
}

.store-note a {
  color: var(--red-light);
  text-decoration: none;
}

.store-note a:hover {
  text-decoration: underline;
}

/* Discord */
.discord-banner {
  position: relative;
  z-index: 1;
  padding: 3.5rem 1.5rem;
}

.discord-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 2rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-red);
  border-radius: var(--radius);
}

.discord-inner h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.discord-inner p {
  color: var(--grey-500);
  font-size: 0.9rem;
}

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--grey-500);
  font-size: 0.8rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.footer-logo {
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(220, 38, 38, 0.25));
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.85rem;
}

.footer-links a {
  color: var(--grey-500);
  text-decoration: none;
}

.footer-links a:hover { color: var(--red-light); }

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.65rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-red);
  color: var(--grey-100);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 200;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(10, 10, 10, 0.98);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s, opacity 0.25s;
  }

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

  .nav-links a { padding: 0.75rem 2rem; width: 100%; }
  .nav-discord { margin: 0.5rem 2rem 0; text-align: center; }
  .nav-toggle { display: flex; }
  .ip-row { flex-direction: column; align-items: stretch; }
  .copy-btn { justify-content: center; }
  .discord-inner { flex-direction: column; text-align: center; }
}
