/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ─── DESIGN TOKENS ─── */
:root {
  --ink:      #080808;
  --ash:      #111111;
  --smudge:   #1c1c1c;
  --fog:      #2a2a2a;
  --paper:    #ffffff;
  --pale:     rgba(240,236,227,0.55);
  --hairline: rgba(240,236,227,0.09);
  --burn:     #e04918;
  --burn-lt:  #f06030;
  --grow:     #4ade80;
  --sky:      #38bdf8;
  --warn:     #f59e0b;
  --danger:   #ef4444;
  --rnd:      4px;
}

/* ─── BASE ─── */
body {
  font-family: 'Press Start 2P', monospace;
  background: var(--ink);
  color: var(--paper);
  line-height: 1.6;
  overflow-x: hidden;
}

/* grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.35;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; background: none; border: none; }

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: var(--burn); }

/* ─── STARFIELD CANVAS ─── */
#stars {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
/* keep real content painted above the fixed starfield */
#navbar, #mobnav, section, footer { position: relative; z-index: 1; }

/* ─── WORDMARK ─── */
.wordmark { line-height: 1; }
.wordmark .p1 { color: var(--burn); }
.wordmark .p2 { color: var(--grow); }
.wordmark .p3 { color: var(--sky); }
.wordmark .p4 { color: #fff; }

/* ─── NAVBAR ─── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 0 clamp(1rem,4vw,2.5rem);
  height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.3s, border-bottom 0.3s;
}
#navbar.scrolled {
  background: rgba(8,8,8,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hairline);
}
.nav-brand { font-size: 0.85rem; letter-spacing: 0.02em; }
.nav-brand .p4 { display: none; }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-links {
  display: flex; align-items: center; gap: 1.6rem; list-style: none;
}
.nav-links a {
  font-size: 0.5rem; letter-spacing: 0.02em;
  color: var(--pale);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--paper); }
.nav-pill {
  font-size: 0.48rem; letter-spacing: 0.02em;
  padding: 0.5rem 0.85rem; border-radius: 2px; border: none;
  cursor: pointer; white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s;
}
.nav-pill:hover { opacity: 0.85; transform: translateY(-1px); }
.nav-pill.discord { background: #5865F2; color: #fff; }
.nav-pill.youtube { background: #FF0000; color: #fff; }
.nav-pill.donate  { background: #f5c400; color: #000; }
.nav-pill.donate:hover { background: #ffd700; opacity: 1; }

@media (max-width: 900px) {
  .nav-links { display: none; }
}

/* hamburger */
#burgerbtn {
  display: none; flex-direction: column; gap: 5px;
  background: transparent; border: none; padding: 6px;
}
#burgerbtn span {
  display: block; width: 22px; height: 2px;
  background: var(--paper); border-radius: 1px;
  transition: transform 0.28s, opacity 0.28s;
}
#burgerbtn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#burgerbtn.open span:nth-child(2) { opacity: 0; }
#burgerbtn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
#mobnav {
  display: none; position: fixed;
  top: 58px; left: 0; right: 0;
  background: rgba(8,8,8,0.97); backdrop-filter: blur(16px);
  padding: 1.4rem clamp(1rem,4vw,2.5rem) 1.8rem;
  z-index: 999; border-bottom: 1px solid var(--hairline);
  flex-direction: column; gap: 1.2rem;
}
#mobnav.open { display: flex; }
#mobnav a {
  font-size: 0.6rem;
  color: var(--pale); padding: 0.35rem 0; transition: color 0.2s;
}
#mobnav a:hover { color: var(--paper); }
@media (max-width: 767px) {
  .nav-right .nav-pill { display: none; }
  #burgerbtn { display: flex; }
}

/* ─── HERO ─── */
#hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 100px 28px 80px;
}

/* ─── HERO CARDS (respawn anchor / end ship) ─── */
.hero-cards {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; width: 100%; max-width: 640px;
}
.hero-card {
  background: var(--fog); border-radius: var(--rnd);
  padding: 20px 18px;
  display: flex; align-items: center; gap: 14px;
  text-align: left;
  min-height: 118px;
  border: 2px solid var(--hairline);
}
.respawn-img {
  width: 64px; height: 64px; flex-shrink: 0;
  image-rendering: pixelated; cursor: pointer;
  transition: filter 0.1s;
}
.end-ship-img {
  width: 90px; height: 66px; object-fit: contain; flex-shrink: 0;
  image-rendering: pixelated;
}
.hero-card-txt { flex: 1; }
.hc-sub { font-size: 0.4rem; color: var(--pale); margin-bottom: 8px; }
.hc-main { font-size: 0.6rem; line-height: 1.7; }
.hc-main .under { display: block; font-size: 0.42rem; color: rgba(240,236,227,0.7); margin-top: 6px; }
@media (max-width: 640px) { .hero-cards { grid-template-columns: 1fr; } }

#hero-content {
  display: flex; flex-direction: column;
  align-items: center; gap: 1.4rem;
  max-width: 740px; width: 100%;
}

.hero-logo {
  font-size: clamp(2.2rem,9vw,5.5rem);
  letter-spacing: 0.04em; line-height: 1;
}
.hero-sub {
  font-size: 0.5rem;
  color: var(--pale); letter-spacing: 0.14em; text-transform: uppercase;
}

/* ─── STATUS PILL ─── */
.ping-pill {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 0.45rem; color: var(--pale);
  background: rgba(255,255,255,0.05); border: 2px solid var(--hairline);
  padding: 0.55rem 1.1rem; border-radius: 2px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--grow); box-shadow: 0 0 5px var(--grow);
  flex-shrink: 0;
  animation: statusPulse 2.5s ease-in-out infinite;
}
.status-dot.offline {
  background: var(--danger); box-shadow: 0 0 5px var(--danger); animation: none;
}
@keyframes statusPulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ─── SERVER BOX ─── */
.server-box {
  width: 100%; max-width: 400px;
  background: rgba(16,16,16,0.88); border: 2px solid var(--hairline);
  border-radius: var(--rnd); backdrop-filter: blur(10px);
  overflow: hidden;
}
.srow {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 1.1rem; cursor: pointer;
  transition: background 0.18s;
  border-bottom: 1px solid var(--hairline); gap: 0.4rem;
}
.srow:last-of-type { border-bottom: none; }
.srow:hover { background: rgba(255,255,255,0.04); }
.slabel {
  font-size: 0.4rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--pale); flex-shrink: 0; width: 96px;
}
.sval {
  font-size: 0.6rem; color: var(--paper); flex: 1; text-align: left;
}
.sicon {
  width: 26px; height: 26px; border-radius: 2px;
  background: rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.18s;
}
.srow:hover .sicon { background: rgba(255,255,255,0.14); }
.sicon svg { width: 12px; height: 12px; stroke: var(--pale); fill: none; }
.server-tags {
  display: flex; gap: 0.4rem; padding: 0.6rem 1.1rem;
  background: rgba(0,0,0,0.25); border-top: 1px solid var(--hairline);
}
.server-tag {
  font-size: 0.38rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.22rem 0.55rem; border-radius: 2px;
  border: 1px solid var(--hairline); color: var(--pale);
}

/* ─── SCROLL NUDGE ─── */
.scroll-nudge {
  position: absolute; bottom: 32px; left: 50%;
  transform: translateX(-50%); z-index: 4;
  display: flex; flex-direction: column; align-items: center;
  animation: bob 2.2s ease-in-out infinite;
}
.scroll-nudge svg { width: 20px; height: 20px; stroke: rgba(240,236,227,0.3); fill: none; }
@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(7px); }
}

/* ─── COPY TOAST ─── */
.copy-toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--grow); color: #000;
  font-size: 0.5rem;
  padding: 0.55rem 1.1rem; border-radius: 2px;
  z-index: 9999; pointer-events: none;
  opacity: 0; transition: opacity 0.22s, transform 0.22s;
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── SHARED SECTION STYLES ─── */
section { padding: 80px 0; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }

.section-tag {
  display: inline-block;
  font-size: 0.5rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--pale); margin-bottom: 0.9rem;
  border: 1px solid var(--hairline);
  padding: 0.3rem 0.6rem; border-radius: 2px;
}
.section-head {
  font-size: clamp(1.1rem,3.5vw,2rem);
  line-height: 1.4;
  letter-spacing: 0.02em; margin-bottom: 1.2rem;
}
.section-body {
  font-size: 0.6rem;
  color: rgba(240,236,227,0.68); max-width: 540px; line-height: 2;
}
.sec-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.sec-title .section-tag,
.sec-title .section-head { margin-bottom: 0; }
.sec-title + .section-body { margin: 0 auto 2.5rem; text-align: center; }

/* ─── ABOUT ─── */
#about { background: var(--ash); position: relative; overflow: hidden; }
.about-photo {
  position: absolute; right: 0; top: 0; bottom: 0; width: 40%;
  object-fit: cover; opacity: 0.1;
  mask-image: linear-gradient(to left, rgba(0,0,0,0.5), transparent);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.5), transparent);
  pointer-events: none;
}
#about .wrap { position: relative; z-index: 1; }

.stat-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 1rem; margin-top: 2.5rem;
}
.stat-card {
  background: var(--fog); border-radius: var(--rnd);
  border-bottom: 5px solid #000; padding: 1.4rem 1.2rem;
}
.stat-lbl {
  font-size: 0.38rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--pale); margin-bottom: 0.6rem;
}
.stat-val { font-size: 0.88rem; color: var(--paper); }
@media (max-width: 767px) { .stat-grid { grid-template-columns: 1fr; } }

/* ─── FEATURES ─── */
#features { background: var(--ink); }
.features-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 1.1rem; margin-top: 2.8rem;
}
.fcard {
  background: var(--fog); border-radius: var(--rnd);
  border-bottom: 5px solid #000; border-left: 3px solid var(--hairline);
  padding: 1.8rem 1.6rem;
  transition: transform 0.2s, border-left-color 0.22s;
}
.fcard:hover { transform: translateY(-4px); border-left-color: var(--burn); }
.fcard-num {
  font-size: 0.4rem; letter-spacing: 0.1em;
  color: var(--pale); margin-bottom: 0.9rem;
}
.fcard h3 { font-size: 0.65rem; line-height: 1.5; margin-bottom: 0.8rem; }
.fcard p {
  font-size: 0.45rem;
  color: rgba(240,236,227,0.6); line-height: 1.9;
}
@media (max-width: 767px) { .features-grid { grid-template-columns: 1fr; } }
@media (min-width: 768px) and (max-width: 1023px) { .features-grid { grid-template-columns: 1fr 1fr; } }

/* ─── GALLERY ─── */
#shots { padding: 0; background: var(--ash); overflow: hidden; }
.shot-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 2px;
}
.shot-grid img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block;
  transition: transform 0.38s, filter 0.38s;
  filter: brightness(0.75) saturate(0.8);
}
.shot-grid img:hover {
  transform: scale(1.04); filter: brightness(1) saturate(1);
  z-index: 1; position: relative;
}
@media (max-width: 767px) {
  .shot-grid {
    display: flex; flex-wrap: nowrap; overflow-x: auto;
    gap: 8px; padding: 14px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  }
  .shot-grid img {
    flex-shrink: 0; width: 270px; height: 152px;
    border-radius: var(--rnd); scroll-snap-align: start;
  }
}

/* ─── JOIN / CONNECT ─── */
#join { background: var(--ash); }
.join-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.1rem; margin-top: 2.8rem;
}
.join-card {
  background: var(--fog); border-radius: var(--rnd);
  border-bottom: 5px solid #000; padding: 1.8rem 1.6rem;
}
.join-card-head {
  font-size: 0.65rem;
  margin-bottom: 1.2rem; display: flex; align-items: center; gap: 0.6rem;
}
.edition-tag {
  font-size: 0.34rem; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 0.22rem 0.55rem; border-radius: 2px;
  background: rgba(255,255,255,0.07); color: var(--pale);
}
.join-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 0; border-bottom: 1px solid var(--hairline); gap: 0.4rem;
}
.join-row:last-child { border-bottom: none; }
.join-row-k {
  font-size: 0.38rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--pale); flex-shrink: 0;
}
.join-row-v { font-size: 0.58rem; color: var(--paper); text-align: right; }
.join-footer { display: flex; flex-direction: column; align-items: center; }
.cross-note {
  text-align: center;
  font-size: 0.42rem; letter-spacing: 0.04em;
  color: var(--pale); margin-top: 1.8rem; line-height: 1.8;
}
@media (max-width: 767px) { .join-grid { grid-template-columns: 1fr; } }

/* ─── RULES ─── */
#rules-section { background: var(--ink); }
.rule-block {
  background: var(--fog); border-radius: var(--rnd);
  border: 2px solid var(--hairline);
  padding: 28px; margin: 2.5rem auto 0;
  display: block; width: fit-content;
}
.rule-only { font-size: clamp(.7rem, 2.5vw, 1.1rem); line-height: 1.8; }
.rule-only .hl-red { color: var(--danger); }

/* ─── FOOTER ─── */
footer {
  background: #050505; border-top: 1px solid var(--hairline);
  padding: 48px 28px 34px; text-align: center;
}
.foot-logo { font-size: 1.6rem; margin-bottom: 1.4rem; }
.foot-links {
  display: flex; justify-content: center; gap: 1.6rem;
  flex-wrap: wrap; margin-bottom: 1.4rem;
}
.foot-links a {
  font-size: 0.42rem; letter-spacing: 0.04em;
  color: var(--pale); transition: color 0.2s;
}
.foot-links a:hover { color: var(--paper); }
.foot-line {
  font-size: 0.38rem; color: rgba(240,236,227,0.28);
  margin-bottom: 0.4rem; line-height: 2;
}
.foot-fine { font-size: 0.38rem; color: rgba(240,236,227,0.16); }
