/* =============================================================================
   Saltbox.gg — landing page
   Design tokens mirror server/gamemodes/gmodracer/gamemode/sh_theme.lua so the
   site reads as the same product as the in-game UI. If you re-skin one, re-skin
   the other.
   ========================================================================== */

:root {
  /* Brand */
  --accent: #FFC828;
  --accent-soft: rgba(255, 200, 40, 0.14);
  --accent-glow: rgba(255, 200, 40, 0.35);

  /* Surfaces (dark to light, matches sh_theme.lua) */
  --surface-0: #14161C;
  --surface-1: #222630;
  --surface-2: #2E3442;
  --surface-3: #1A1E26;
  --border:    #3C4454;
  --border-soft: rgba(60, 68, 84, 0.55);

  /* Text */
  --text:     #E1E4EB;
  --text-dim: #969EAF;
  --text-dis: #5C6478;

  /* Status */
  --success: #78C878;
  --info:    #6EC8F0;
  --warning: #FFAF3C;
  --danger:  #DC4646;

  /* Type */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Geometry */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { padding: 0; margin: 0; list-style: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; }
::selection { background: var(--accent); color: #1a1300; }

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

/* ---------- backdrop fx ---------- */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 75%);
}
.bg-glow {
  position: absolute;
  top: -40vh;
  left: 50%;
  transform: translateX(-50%);
  width: 120vw;
  height: 100vh;
  background: radial-gradient(ellipse at center,
    rgba(255, 200, 40, 0.10) 0%,
    rgba(255, 200, 40, 0.04) 25%,
    transparent 60%);
  filter: blur(40px);
}
.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 56px);
  background: rgba(20, 22, 28, 0.65);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}
.brand-word { color: var(--text); }
.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.topnav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-dim);
  transition: color .15s var(--ease-out), background .15s var(--ease-out);
}
.topnav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.topnav-cta {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 8px 14px !important;
  background: var(--accent) !important;
  color: #1a1300 !important;
  font-weight: 600 !important;
  border-radius: var(--radius-sm);
}
.topnav-cta:hover {
  background: #ffd44a !important;
  transform: translateY(-1px);
}
@media (max-width: 720px) {
  .topnav a:not(.topnav-cta) { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: transform .12s var(--ease-out),
              background .15s var(--ease-out),
              border-color .15s var(--ease-out),
              box-shadow .15s var(--ease-out);
  white-space: nowrap;
}
.btn-sm { padding: 10px 16px; font-size: 14px; border-radius: 8px; }
.btn-primary {
  background: var(--accent);
  color: #1a1300;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 8px 24px -10px var(--accent-glow);
}
.btn-primary:hover {
  background: #ffd44a;
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 14px 32px -12px var(--accent-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #4d586b;
  transform: translateY(-1px);
}

/* ---------- layout helpers ---------- */
main { display: block; }
.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(64px, 10vw, 120px) clamp(20px, 5vw, 56px);
}
.section-head {
  max-width: 720px;
  margin: 0 0 48px;
}
.kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.section h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
  margin-bottom: 16px;
}
.lede {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 60ch;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(64px, 12vw, 140px) clamp(20px, 5vw, 56px) clamp(48px, 8vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: center;
}
.hero-inner { max-width: 720px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 28px;
}
.hero-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(120, 200, 120, 0.18);
  animation: pulse 2.4s var(--ease-out) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(120, 200, 120, 0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(120, 200, 120, 0.04); }
}

.hero-title {
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
}
.hero-title .title-line {
  display: block;
  /* Extends the background-clip:text painting box past the line-box so glyph
     descenders (g, p, y) stay painted instead of being clipped at the baseline.
     Without this, "logging into." shows truncated g's in browsers that compute
     the gradient fill area against the line box rather than the ink box. */
  padding-block-end: 0.08em;
}
.hero-title .accent {
  background: linear-gradient(180deg, #FFD96B 0%, var(--accent) 50%, #E0A800 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 56ch;
  margin-bottom: 36px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border-soft);
  margin: 0;
}
.hero-meta div { min-width: 0; }
.hero-meta dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dis);
  margin-bottom: 6px;
}
.hero-meta dd {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
@media (max-width: 560px) {
  .hero-meta { grid-template-columns: 1fr; gap: 16px; }
}

.hero-mark {
  position: relative;
  width: clamp(180px, 22vw, 280px);
  aspect-ratio: 1;
  filter: drop-shadow(0 30px 60px rgba(255, 200, 40, 0.18));
  animation: float 6s var(--ease-out) infinite;
}
.hero-mark img {
  width: 100%;
  height: 100%;
  border-radius: 22%;
}
.hero-mark::after {
  content: '';
  position: absolute;
  inset: -10%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  z-index: -1;
  filter: blur(30px);
  opacity: 0.6;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .hero-mark { display: none; }
}

/* ---------- SERVERS ---------- */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
}
.server-card {
  position: relative;
  padding: 28px;
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-3) 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  transition: transform .25s var(--ease-out),
              border-color .25s var(--ease-out),
              box-shadow .25s var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow: hidden;
}
.server-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(255, 200, 40, 0.0) 30%, rgba(255, 200, 40, 0.25) 50%, rgba(255, 200, 40, 0.0) 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity .3s var(--ease-out);
  pointer-events: none;
}
.server-card:hover {
  transform: translateY(-3px);
  border-color: rgba(60, 68, 84, 0.9);
  box-shadow:
    0 20px 60px -25px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 200, 40, 0.05);
}
.server-card:hover::before { opacity: 1; }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.card-title h3 {
  font-size: 22px;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.card-sub {
  font-size: 13.5px;
  color: var(--text-dim);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-pill .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-live {
  color: var(--success);
  background: rgba(120, 200, 120, 0.10);
  border-color: rgba(120, 200, 120, 0.25);
}
.status-live .status-dot {
  box-shadow: 0 0 0 3px rgba(120, 200, 120, 0.18);
  animation: pulse-green 2s var(--ease-out) infinite;
}
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 3px rgba(120, 200, 120, 0.18); }
  50%      { box-shadow: 0 0 0 5px rgba(120, 200, 120, 0.04); }
}
.status-soon {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-soft);
}
.status-offline {
  color: var(--text-dim);
  background: rgba(220, 70, 70, 0.06);
  border-color: rgba(220, 70, 70, 0.2);
}

.card-blurb {
  font-size: 14.5px;
  color: var(--text-dim);
  line-height: 1.55;
}

.card-stats {
  display: grid;
  grid-template-columns: auto auto 1fr;
  column-gap: 28px;
  row-gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  margin: 0;
  align-items: start;
}
/* Each <div> in card-stats is a label-on-top, value-below stack inside its
   own grid cell. Do NOT use display:contents here — that flattens the dt/dd
   into the parent grid and the labels and values misalign across columns. */
.card-stats > div { min-width: 0; }
.card-stats dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dis);
  margin-bottom: 6px;
}
.card-stats dd {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}
@media (max-width: 480px) {
  .card-stats { grid-template-columns: 1fr; row-gap: 14px; }
}

/* "On now" player chips strip — small avatars-of-text under the stats grid.
   Hidden when no players are connected so empty servers stay clean. */
.card-players {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.card-players[data-has-players="true"] { display: flex; }
.card-players-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dis);
  margin-right: 6px;
}
.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}
.player-chip-more {
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 8px;
}

.copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  transition: all .15s var(--ease-out);
  position: relative;
}
.copy code { font-family: inherit; }
.copy:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border);
  color: var(--accent);
}
.copy .copy-i { color: var(--text-dim); transition: color .15s var(--ease-out); }
.copy:hover .copy-i { color: var(--accent); }
.copy .copy-ok {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(120, 200, 120, 0.18);
  color: var(--success);
  border-radius: inherit;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s var(--ease-out);
}
.copy.is-copied .copy-ok { opacity: 1; }

.card-ctas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.muted { color: var(--text-dis); }
.server-card--soon { opacity: 0.85; }
.server-card--soon:hover { opacity: 1; }

/* skeleton dash for unloaded values */
.skel { color: var(--text-dis); }

/* ---------- ABOUT ---------- */
.section-about {
  padding-top: clamp(48px, 8vw, 96px);
  padding-bottom: clamp(48px, 8vw, 96px);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px 80px;
  align-items: start;
}
.about-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
}
.about-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 16.5px;
  color: var(--text-dim);
}
.about-body p { line-height: 1.65; }
.pillars {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--border-soft);
}
.pillars li {
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  transition: background .2s var(--ease-out), border-color .2s var(--ease-out);
}
.pillars li:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}
.pillar-i {
  display: inline-flex;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.pillar-i svg { width: 22px; height: 22px; }
.pillars h3 {
  font-size: 16px;
  margin-bottom: 6px;
}
.pillars p {
  font-size: 14px;
  color: var(--text-dim);
}
@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- COMMUNITY ---------- */
.cta-card {
  background:
    linear-gradient(140deg, rgba(255, 200, 40, 0.06) 0%, transparent 60%),
    linear-gradient(180deg, var(--surface-1) 0%, var(--surface-3) 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: clamp(32px, 5vw, 56px);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.cta-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 60%;
  height: 180%;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 60%);
  opacity: 0.18;
  filter: blur(40px);
  pointer-events: none;
}
.cta-copy h2 {
  font-size: clamp(26px, 3.5vw, 36px);
  line-height: 1.1;
  margin-bottom: 14px;
}
.cta-copy .lede { margin-bottom: 28px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.cta-bullets ul {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cta-bullets li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
}
.cta-bullets .check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}
@media (max-width: 880px) {
  .cta-card { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--border-soft);
  padding: 48px 0 56px;
  margin-top: 32px;
}
.foot-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}
.foot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
}
.foot-brand img { border-radius: 7px; }
.foot-tag {
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
}
.foot-links {
  display: flex;
  gap: 6px;
}
.foot-links a {
  padding: 6px 12px;
  font-size: 14px;
  color: var(--text-dim);
  border-radius: 6px;
  transition: color .15s var(--ease-out), background .15s var(--ease-out);
}
.foot-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.foot-fine {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 12px;
  color: var(--text-dis);
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}
@media (max-width: 720px) {
  .foot-inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}

/* ---------- reveal-on-scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .hero-mark { animation: none; }
}
