:root {
  --bg:       #080c14;
  --bg-1:     #0d1220;
  --bg-2:     #111827;
  --bg-3:     #1a2235;
  --border:   rgba(255,255,255,0.07);
  --border-2: rgba(255,255,255,0.12);
  --text:     #e8edf5;
  --muted:    #64748b;
  --accent:   #7ee787;
  --accent-d: #5bc768;
  --blue:     #58a6ff;
  --radius:   14px;
  --radius-sm: 8px;
  --navbar-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.hidden { display: none !important; }
.muted  { color: var(--muted); font-size: 14px; }
.w-full { width: 100%; }

.btn-primary, .btn-outline, .btn-ghost, .btn-accent {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 100px;
  font-family: 'Manrope', sans-serif;
  font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: transform .2s, box-shadow .2s, background .2s;
  border: none;
}

.btn-primary {
  background: var(--accent); color: #080c14;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(126,231,135,.25); }

.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-2);
}
.btn-outline:hover { border-color: rgba(255,255,255,.3); transform: translateY(-2px); }

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

.btn-accent {
  background: var(--accent); color: #080c14;
}
.btn-accent:hover { background: var(--accent-d); transform: translateY(-1px); }

.btn-submit {
  width: 100%; padding: 13px;
  background: var(--accent); color: #080c14;
  border: none; border-radius: 100px;
  font-family: 'Manrope', sans-serif;
  font-size: 15px; font-weight: 700;
  cursor: pointer; transition: .2s;
  margin-top: 8px;
}
.btn-submit:hover { background: var(--accent-d); transform: translateY(-1px); }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.fade {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.fade.show { opacity: 1; transform: translateY(0); }

.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--navbar-h); z-index: 1000;
  background: rgba(8, 12, 20, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background .3s;
}

.nav-inner {
  max-width: 1200px; margin: 0 auto;
  height: 100%; padding: 0 32px;
  display: flex; align-items: center; gap: 32px;
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 22px;
  color: var(--accent); letter-spacing: -0.5px;
  flex-shrink: 0;
}

.nav-links {
  display: flex; gap: 8px; flex: 1;
}

.nav-links a {
  text-decoration: none; color: var(--muted);
  padding: 6px 14px; border-radius: 100px;
  font-size: 14px; font-weight: 500;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-3); }

.nav-right {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
}

.nav-status {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 100px;
  background: var(--bg-2); border: 1px solid var(--border);
  font-size: 13px; color: var(--muted);
}

.nav-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted); flex-shrink: 0;
  transition: background .5s;
}
.nav-dot.online { background: var(--accent); box-shadow: 0 0 8px rgba(126,231,135,.5); }

.user-menu { position: relative; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 100px; padding: 5px 12px 5px 5px;
  color: var(--text); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: .2s;
}
.user-chip:hover { border-color: var(--border-2); background: var(--bg-3); }

.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(126,231,135,.15); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}

.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); padding: 6px;
  min-width: 180px; display: none;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.user-dropdown.open { display: block; }

.user-dropdown a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 6px;
  color: var(--text); text-decoration: none;
  font-size: 14px; transition: background .15s;
}
.user-dropdown a:hover { background: var(--bg-3); }
.user-dropdown .logout-link { color: #f87171; }
.user-dropdown .logout-link:hover { background: rgba(248,113,113,.08); }

.menu-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.menu-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: .3s;
}

.mobile-menu {
  display: none; flex-direction: column; gap: 4px;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--border);
  background: rgba(8,12,20,.95);
}
.mobile-menu.open { display: flex; }

.mobile-menu a {
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-size: 15px;
  transition: background .15s;
}
.mobile-menu a:hover { background: var(--bg-3); }

.mobile-divider { height: 1px; background: var(--border); margin: 8px 0; }

.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  position: relative; overflow: hidden;
  padding: calc(var(--navbar-h) + 60px) 10% 80px;
  background: linear-gradient(to bottom, rgba(8,12,20,.85), rgba(8,12,20,.95)),
              url("screenshots/bg.jpg") center/cover no-repeat;
}

#particles-canvas {
  position: absolute; inset: 0;
  pointer-events: none;
}

.hero-glow {
  position: absolute; top: 20%; left: 10%;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(126,231,135,.04) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; max-width: 680px; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(126,231,135,.08); border: 1px solid rgba(126,231,135,.2);
  border-radius: 100px; padding: 6px 14px;
  font-size: 13px; color: var(--accent); font-weight: 500;
  margin-bottom: 24px;
}

.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:.5;transform:scale(.8);} }

.hero-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(52px, 8vw, 88px);
  line-height: .95; letter-spacing: -3px;
  margin-bottom: 20px;
}

.title-accent { color: var(--accent); display: block; }
.title-light  { color: rgba(232,237,245,.25); display: block; }

.hero-sub {
  font-size: 18px; color: var(--muted);
  margin-bottom: 32px; line-height: 1.6;
}

.server-chip-row {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 32px;
}

.server-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(13,18,32,.9); border: 1px solid var(--border);
  border-radius: 100px; padding: 9px 16px;
  font-size: 14px; backdrop-filter: blur(10px);
}

.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.chip-dot.online { background: var(--accent); box-shadow: 0 0 8px rgba(126,231,135,.5); }

.ip-chip { font-family: 'SF Mono', 'Fira Code', monospace; color: var(--blue); border-color: rgba(88,166,255,.2); background: rgba(88,166,255,.04); }

.hero-btns { display: flex; flex-wrap: wrap; gap: 10px; }

.hero-scroll-hint {
  position: absolute; bottom: 32px; left: 10%;
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(100,116,139,.5);
}
.scroll-line {
  width: 40px; height: 1px;
  background: linear-gradient(90deg, rgba(100,116,139,.4), transparent);
}

.section { padding: 100px 10%; }
.section-dark { background: var(--bg-1); }

.section-inner { max-width: 1100px; margin: 0 auto; }

.section-label {
  font-size: 12px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700; letter-spacing: -1px;
  margin-bottom: 48px; line-height: 1.1;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 16px;
}

.feature-card {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: transform .3s, border-color .3s, box-shadow .3s;
  position: relative;
}
.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(126,231,135,.2);
  box-shadow: 0 20px 40px rgba(0,0,0,.3), 0 0 0 1px rgba(126,231,135,.06);
}

.feature-big {
  grid-column: 1 / 3;
}

.feature-icon { font-size: 28px; margin-bottom: 14px; }

.feature-card h3 {
  font-family: 'Syne', sans-serif;
  font-size: 18px; font-weight: 700; margin-bottom: 8px;
}

.feature-card p { font-size: 14px; color: var(--muted); line-height: 1.6; }

.feature-tag {
  position: absolute; top: 20px; right: 20px;
  background: rgba(126,231,135,.1); color: var(--accent);
  border: 1px solid rgba(126,231,135,.2);
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; padding: 3px 10px; border-radius: 100px;
}

.gallery {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  grid-template-rows: 240px 200px;
  gap: 12px;
}

.gallery-main  { grid-row: 1; grid-column: 1; }
.gallery-side  { grid-row: 1; grid-column: 2; display: flex; flex-direction: column; gap: 12px; }
.gallery-sm    { flex: 1; }
.gallery-wide  { grid-row: 2; grid-column: 1 / -1; }

.gallery-main img,
.gallery-sm img,
.gallery-wide img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: transform .4s, border-color .4s;
  display: block;
}
.gallery-main img:hover,
.gallery-sm img:hover,
.gallery-wide img:hover {
  border-color: rgba(126,231,135,.2);
}

.join-section {
  background: radial-gradient(ellipse at 60% 50%, rgba(126,231,135,.05) 0%, transparent 60%), var(--bg);
}

.join-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px;
  align-items: center;
}

.join-text p { color: var(--muted); font-size: 16px; margin-bottom: 32px; }
.join-btns { display: flex; flex-wrap: wrap; gap: 10px; }

.join-server-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden;
}

.join-ip-block {
  padding: 28px; border-bottom: 1px solid var(--border);
}

.join-ip-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.join-ip { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 20px; color: var(--blue); margin-bottom: 16px; }

.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border-2);
  color: var(--muted); padding: 7px 14px; border-radius: 100px;
  font-size: 13px; cursor: pointer; transition: .2s;
}
.copy-btn:hover { background: var(--bg-3); color: var(--text); }

.join-stats {
  display: flex; align-items: center;
  padding: 20px 28px; gap: 0;
}

.join-stat { flex: 1; text-align: center; }
.join-stat-val { display: block; font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 700; color: var(--text); }
.join-stat-label { font-size: 12px; color: var(--muted); }
.join-stat-divider { width: 1px; height: 40px; background: var(--border); }

.footer {
  padding: 28px 10%;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 24px;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 18px; color: var(--accent);
  margin-right: auto;
}

.footer-copy { font-size: 13px; color: var(--muted); }
.footer-credit { font-size: 13px; color: var(--muted); }
.footer-credit a { color: var(--accent); text-decoration: none; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.7); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  position: relative;
  background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: 20px; padding: 36px;
  width: 100%; max-width: 400px;
  animation: modalIn .25s ease;
}
.modal-wide { max-width: 480px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--bg-3); border: none; color: var(--muted);
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: .2s;
}
.modal-close:hover { background: var(--border-2); color: var(--text); }

.modal-header { text-align: center; margin-bottom: 28px; }

.modal-logo {
  font-family: 'Syne', sans-serif;
  font-size: 20px; font-weight: 800; color: var(--accent);
  margin-bottom: 12px;
}

.modal-header h2 { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.modal-header p  { font-size: 14px; color: var(--muted); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.field input {
  width: 100%; padding: 11px 14px;
  background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 15px; font-family: 'Manrope', sans-serif;
  transition: border-color .2s;
}
.field input:focus { outline: none; border-color: rgba(126,231,135,.4); }
.field input::placeholder { color: var(--muted); }
.field-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }

.optional { color: var(--muted); font-weight: 400; }

.form-error {
  background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.2);
  color: #f87171; font-size: 13px; padding: 10px 14px;
  border-radius: var(--radius-sm); margin-bottom: 8px;
}

.modal-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }
.modal-switch a { color: var(--accent); text-decoration: none; font-weight: 600; }

.cabinet-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 28px;
}

.cabinet-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(126,231,135,.1); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800;
  flex-shrink: 0;
}

.cabinet-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 22px; font-weight: 700;
}

.cabinet-tabs {
  display: flex; gap: 4px;
  background: var(--bg-3); border-radius: var(--radius-sm);
  padding: 4px; margin-bottom: 24px;
}

.tab {
  flex: 1; padding: 9px; border-radius: 6px;
  background: transparent; border: none;
  color: var(--muted); font-family: 'Manrope', sans-serif;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: .2s;
}
.tab.active { background: var(--bg-2); color: var(--text); }

.upload-area {
  border: 2px dashed var(--border-2); border-radius: var(--radius);
  padding: 40px 24px; text-align: center;
  transition: border-color .2s, background .2s;
  cursor: pointer;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: rgba(126,231,135,.4); background: rgba(126,231,135,.02);
}
.upload-area.drag-over { border-style: solid; }

.upload-icon { color: var(--muted); margin-bottom: 16px; display: flex; justify-content: center; }
.upload-title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.upload-hint { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.upload-link { color: var(--accent); cursor: pointer; text-decoration: underline; }

.upload-result {
  background: rgba(126,231,135,.06); border: 1px solid rgba(126,231,135,.2);
  border-radius: var(--radius); padding: 20px;
}
.result-ok {
  display: flex; align-items: center; gap: 10px;
  color: var(--accent); font-weight: 600; font-size: 15px;
}

.upload-error {
  background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.2);
  color: #f87171; font-size: 13px; padding: 12px 16px;
  border-radius: var(--radius-sm); margin-top: 12px;
}

@media (max-width: 1024px) {
  .features-grid { grid-template-columns: 1fr 1fr; }
  .feature-big { grid-column: 1 / -1; }
  .join-inner { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-status { display: none; }
  .menu-toggle { display: flex; }

  #auth-btns { display: none; }
  #user-menu .user-chip > span:not(.user-avatar) { display: none; }

  .section { padding: 72px 6%; }
  .hero { padding: calc(var(--navbar-h) + 40px) 6% 60px; }

  .hero-title { letter-spacing: -2px; }
  .hero-btns { flex-direction: column; }
  .hero-btns a { justify-content: center; }

  .features-grid { grid-template-columns: 1fr; }
  .feature-big { grid-column: auto; }

  .gallery {
    grid-template-columns: 1fr;
    grid-template-rows: 220px 140px 140px 180px;
  }
  .gallery-side { grid-row: auto; grid-column: auto; flex-direction: row; }
  .gallery-wide { grid-row: auto; grid-column: auto; }

  .hero-scroll-hint { display: none; }

  .cabinet-header { gap: 12px; }
  .modal { padding: 24px; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 0 20px; }
  .section { padding: 60px 5%; }
  .hero { padding: calc(var(--navbar-h) + 28px) 5% 48px; }
  .server-chip-row { flex-direction: column; align-items: flex-start; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-logo { margin-right: 0; }
}
