/* ========================================================================
   Primal — primalps.org
   Theme: dark charcoal with warm gold accent (classic RSPS).
   To re-skin, swap the variables in :root.
   ======================================================================== */

:root {
  /* Palette pulled from the launcher design + wordmark logo:
   * - dark blue base (not pure black, slight cool tint)
   * - teal/cyan accent (from the shield)
   * - metallic gold for primary CTAs (matches the PRIMAL wordmark)
   */
  --bg:            #0c1018;   /* dark blue-tinted background */
  --bg-elevated:   #131826;   /* panel surfaces */
  --bg-card:       #1a2030;   /* card surfaces */
  --border:        #243044;   /* card borders */
  --text:          #e8edf3;
  --text-muted:    #8a96a8;

  --accent:        #d9a648;   /* metallic gold (PRIMAL letters) */
  --accent-hover:  #e9b658;
  --accent-deep:   #a47b30;   /* gold shadow side, for gradients */
  --accent-fade:   rgba(217, 166, 72, 0.12);

  --accent-2:      #5fa6b8;   /* teal cyan (shield) */
  --accent-2-hover:#7bc0d2;
  --accent-2-fade: rgba(95, 166, 184, 0.14);

  --danger:        #e0635a;   /* warm red, for beta tile + warnings */
  --danger-hover:  #f07770;

  --shadow-card:   0 4px 24px rgba(0, 0, 0, 0.45);
  --radius:        8px;
  --radius-lg:     12px;

  --font-display: 'Cinzel', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-hover); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.01em; line-height: 1.1; margin: 0; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================================================
   Header
   ======================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 14, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  height: 44px;
  width: auto;
  display: block;
  /* subtle glow on hover for the metallic look */
  transition: filter 0.2s ease;
}
.brand:hover .brand-logo {
  filter: drop-shadow(0 0 6px rgba(217, 166, 72, 0.5));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
  margin-right: 16px;
}
.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 15px;
}
.nav-links a:hover { color: var(--text); }

.nav-cta { white-space: nowrap; }

/* Hamburger toggle: hidden on desktop, shown on mobile via the @media block below. */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  width: 40px; height: 40px;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nav-toggle:hover { border-color: var(--accent-2); }
.nav-toggle span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ========================================================================
   Buttons
   ======================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(180deg, var(--accent-hover) 0%, var(--accent) 50%, var(--accent-deep) 100%);
  color: #1a1308;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #f0c878 0%, var(--accent-hover) 50%, var(--accent) 100%);
  color: #1a1308;
}

.btn-secondary {
  background: rgba(95, 166, 184, 0.08);
  color: var(--text);
  border-color: var(--accent-2);
}
.btn-secondary:hover {
  background: rgba(95, 166, 184, 0.18);
  border-color: var(--accent-2-hover);
  color: var(--text);
}

.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ========================================================================
   Hero
   ======================================================================== */
.hero {
  padding: 80px 0 80px;
  text-align: center;
  background:
    radial-gradient(ellipse at top, rgba(95, 166, 184, 0.10), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(217, 166, 72, 0.06), transparent 60%),
    var(--bg);
  position: relative;
  overflow: hidden;
}

.hero-logo {
  max-width: 540px;
  width: 80%;
  height: auto;
  display: block;
  margin: 0 auto 12px;
  /* subtle glow under the wordmark */
  filter: drop-shadow(0 4px 20px rgba(95, 166, 184, 0.25));
}

.hero-eyebrow {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 16px;
}

.hero::before {
  /* subtle vignette */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}

.hero-inner { position: relative; }

.hero-title {
  font-size: clamp(40px, 7vw, 84px);
  text-transform: uppercase;
  margin-bottom: 24px;
}
.hero-title-line-1 { display: block; color: var(--text); }
.hero-title-line-2 {
  display: block;
  background: linear-gradient(135deg, var(--accent), #e4b25d 60%, #f1c878);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline {
  color: var(--text-muted);
  font-size: 18px;
  max-width: 640px;
  margin: 0 auto 36px;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 56px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 56px;
  justify-content: center;
  flex-wrap: wrap;
}

.stat { text-align: center; }
.stat-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.12em;
  margin-top: 8px;
}

/* ========================================================================
   Features
   ======================================================================== */
.features {
  padding: 80px 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: var(--accent-2-fade);
  color: var(--accent-2);
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid rgba(95, 166, 184, 0.25);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-2);
}
.feature-icon svg {
  width: 32px;
  height: 32px;
}

.feature-card h3 {
  font-size: 22px;
  margin-bottom: 10px;
}
.feature-card p {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0;
}

/* ========================================================================
   Community + Leaderboard
   ======================================================================== */
.community {
  padding: 80px 0;
  background: var(--bg);
}

.community-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .community-grid {
    grid-template-columns: 380px 1fr;
    align-items: stretch;
  }
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.panel-title {
  font-size: 22px;
  text-align: center;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 4px 0 20px;
}

/* Discord widget panel -- iframe styles inside come from Discord itself */
.discord-panel {
  padding: 0;
  overflow: hidden;
}
.discord-panel iframe {
  display: block;
  border-radius: var(--radius-lg);
}

/* Leaderboard ---------------------------------------------------------- */
.lb-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.lb-tab {
  flex: 1 1 0;
  min-width: 76px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lb-tab:hover { color: var(--text); border-color: var(--accent-2); }
.lb-tab.is-active {
  background: var(--accent-2-fade);
  color: var(--accent-2);
  border-color: var(--accent-2);
}

.lb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
}
.lb-table thead th {
  text-align: left;
  font-size: 12px;
  font-family: var(--font-body);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px 14px;
}
.lb-table thead th:last-child { text-align: right; }

.lb-table tbody tr {
  background: var(--bg-elevated);
  transition: background 0.15s ease;
}
.lb-table tbody tr:hover { background: var(--border); }

.lb-table tbody td {
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
}
.lb-table tbody td:first-child {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text-muted);
  border-radius: var(--radius) 0 0 var(--radius);
  width: 70px;
}
.lb-table tbody td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Top 3 ranks get medal coloring */
.lb-table tbody tr.rank-1 td:first-child { color: #f0c878; }     /* gold */
.lb-table tbody tr.rank-2 td:first-child { color: #c8d0d8; }     /* silver */
.lb-table tbody tr.rank-3 td:first-child { color: #c98744; }     /* bronze */
.lb-table tbody tr.rank-1 { background: linear-gradient(90deg, rgba(217, 166, 72, 0.10), var(--bg-elevated) 60%); }
.lb-table tbody tr.rank-2 { background: linear-gradient(90deg, rgba(180, 190, 200, 0.08), var(--bg-elevated) 60%); }
.lb-table tbody tr.rank-3 { background: linear-gradient(90deg, rgba(201, 135, 68, 0.10), var(--bg-elevated) 60%); }

/* ========================================================================
   News & Updates
   ======================================================================== */
.news {
  padding: 80px 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  text-align: center;
  font-size: 28px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 0 0 36px;
}

.news-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.news-card:hover { transform: translateY(-3px); border-color: var(--accent-2); }

.news-card h3 {
  font-size: 19px;
  margin-bottom: 12px;
  color: var(--text);
}
.news-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 16px;
}
.news-card .news-date {
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  margin-top: auto;
  margin-bottom: 14px;
}
.btn-card {
  align-self: flex-start;
  padding: 8px 14px;
  font-size: 13px;
}

/* ========================================================================
   CTA Band
   ======================================================================== */
.cta-band {
  padding: 80px 0;
  text-align: center;
}

.cta-band-inner h2 {
  font-size: clamp(28px, 4vw, 42px);
  margin-bottom: 14px;
}
.cta-band-inner p {
  color: var(--text-muted);
  font-size: 17px;
  margin: 0 auto 28px;
  max-width: 540px;
}

/* ========================================================================
   Footer
   ======================================================================== */
.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 40px 0 32px;
}

.footer-inner {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr 1fr;
    text-align: left;
    align-items: center;
  }
  .footer-links { justify-self: center; }
  .footer-copy { justify-self: end; text-align: right; }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-logo {
  height: 36px;
  width: auto;
}
.footer-tag {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 14px;
}
.footer-links a:hover { color: var(--accent); }

.footer-copy {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0;
}

/* ========================================================================
   Mobile tweaks  -- hamburger nav for narrow viewports
   ======================================================================== */
@media (max-width: 720px) {
  .nav { gap: 12px; }
  .nav-cta { padding: 8px 14px; font-size: 13px; }
  .nav-toggle { display: flex; }

  /* Slide the nav out from the top of the header.  Default = closed
     (height 0, hidden).  Adding .is-open on <body> reveals it. */
  .nav-links {
    position: absolute;
    top: 72px;                  /* matches .nav height */
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
    /* slide-down animation */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links a {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    color: var(--text);
    font-weight: 600;
  }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links a:hover { background: rgba(255,255,255,0.04); color: var(--accent); }

  body.is-open .nav-links { max-height: 80vh; }

  .hero { padding: 64px 0 56px; }
  .hero-stats { gap: 32px; }
}
