/* ========== RESET & BASE ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: none !important;
}

@font-face {
  font-family: poppins;
  src: url('resources/Poppins.woff');
}

html {
  scroll-behavior: smooth;
}

html, body {
  font-family: poppins;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

/* Kill the blue/grey tap-highlight flash on mobile taps */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

a {
  text-decoration: none;
  color: inherit;
  outline: none;
}
a:focus, a:active { outline: none; }
a:focus-visible {
  outline: 2px solid var(--accent-start);
  outline-offset: 2px;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
}
button:focus, button:active { outline: none; }
button:focus-visible {
  outline: 2px solid var(--accent-start);
  outline-offset: 2px;
}

:root {
  --accent-start: #ff0029;
  --accent-end: #ff0029;
  --green: #22c55e;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);       /* smooth, no overshoot */
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);  /* gentle ease-out */
  --theme-speed: 0.6s;                          /* liquid, unhurried theme fade */
}

/* ========== SHARED KEYFRAMES ========== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== THEMES ========== */
body.light {
  background: #e9e2ff;
  color: #0d0d0d;
  --bg: #e9e2ff;
  --text: #0d0d0d;
  --text-muted: rgba(13,13,13,0.6);
  --card-bg: #ffffff;
  --card-border: rgba(13,13,13,0.06);
  --outline-btn-border: rgba(13,13,13,0.15);
  --nav-bg: #ffffff;
  --icon-bg: #efeaff;
  --divider: rgba(13,13,13,0.08);
  --shadows: #0d0d0d 0px 0.1px 0px, #0d0d0d 0px 0px 8px;
}

body.dark {
  background: #0d0d0d;
  color: #e9e2ff;
  --bg: #0d0d0d;
  --text: #e9e2ff;
  --text-muted: rgba(233,226,255,0.55);
  --card-bg: #17151f;
  --card-border: rgba(233,226,255,0.08);
  --outline-btn-border: rgba(233,226,255,0.2);
  --nav-bg: #14121c;
  --icon-bg: rgba(106,92,245,0.18);
  --divider: rgba(233,226,255,0.08);
  --shadows: #FFFFFF5C 0px 0.1px 0px, #FFFFFF5C 0px 0px 8px;
}

/* Every element that carries a themed color fades together, at the same
   speed, so light/dark never feels like an abrupt on/off flick. */
body,
.header,
.menu-toggle,
.side-nav,
.side-nav-close,
.side-nav-empty,
.side-nav-divider,
.side-nav-links a,
.side-nav-theme-label,
.theme-toggle,
.theme-toggle .dot,
.stat-card,
.stat-label,
.stat-value,
.feature-card,
.feature-desc,
.step-card,
.rule-card,
.accordion-item,
.accordion-panel,
.chevron,
.bottom-nav,
.nav-item,
.btn-secondary,
.section-title,
.group-label,
.subtitle,
.server-ip,
.feature-title,
.site-footer,
.footer-name,
.footer-links a,
.footer-copy {
  transition: background-color var(--theme-speed) var(--ease),
              border-color var(--theme-speed) var(--ease),
              color var(--theme-speed) var(--ease),
              box-shadow var(--theme-speed) var(--ease);
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

/* ========== APP SHELL ========== */
.phone {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 78px; /* space for bottom nav */
}

/* ========== HEADER ========== */
.header {
  position: sticky;
  top: 10px;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: #E9E2FF14;
  box-shadow: var(--shadows);
  backdrop-filter: blur(3px);
  width: 330px;
  height: 75px;
  border-radius: 15px;
  margin: 10px 15px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nsrp-logo {
  width: 75px;
  border-radius: 5px;
}

.brand-name {
  width: 40px;
  margin-left: 0px;
}

/* Hamburger button that replaces the old bell icon in the header */
.menu-toggle {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text);
  font-size: 25px;
}

@media (hover: hover) and (pointer: fine) {
  .menu-toggle:hover {
    background: var(--icon-bg);
  }
}

/* ========== SIDE NAV (drawer) ========== */
.side-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,13,13,0.45);
  backdrop-filter: blur(2px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s var(--ease);
}

.side-nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.side-nav {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(78vw, 320px);
  background: var(--nav-bg);
  box-shadow: var(--shadows);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  transform: translateX(100%);
  transition: all 0.8s var(--ease-soft);
}

.side-nav.open {
  transform: translateX(0);
}

.side-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.side-nav-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-start);
}

.side-nav-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.side-nav-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 22px;
}

@media (hover: hover) and (pointer: fine) {
  .side-nav-close:hover {
    background: var(--icon-bg);
  }
}

.side-nav-empty {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ===== Scrollable nav body, styled to match the docs sidebar (nav-group-label / nav-link) ===== */
.side-nav-scroll {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--divider);
  overflow-y: auto;
  flex: 1;
}

.nav-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 12px;
  margin: 18px 0 8px;
}

.nav-group-label:first-child {
  margin-top: 0;
}

.side-nav-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-link i {
  width: 16px;
  text-align: center;
  font-size: 13px;
}

.nav-link.active {
  background: rgba(255,0,41,0.12);
  color: var(--accent-start);
  font-weight: 600;
}

@media (hover: hover) and (pointer: fine) {
  .nav-link:hover:not(.active) {
    background: var(--icon-bg);
    color: var(--text);
  }
}

.theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  margin-top: 4px;
}

.theme-row-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.theme-row-label i {
  width: 16px;
  text-align: center;
  font-size: 13px;
}

.theme-toggle {
  width: 44px;
  height: 25px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 3px;
  position: relative;
  flex-shrink: 0;
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle .dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--accent-start);
  position: absolute;
  top: 3px;
  left: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s var(--ease-soft);
}

.theme-toggle .dot i {
  font-size: 9px;
  color: #fff;
}

body.dark .theme-toggle .dot {
  transform: translateX(19px);
}

/* ========== CONTENT ========== */
.content {
  flex: 1;
  padding: 4px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 34px;
}

/* ========== HERO ========== */
.hero {
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.5s var(--ease-soft) forwards;
}

.hero h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-top: -80px;
  color: var(--text);
  padding: 0 20px;
  margin-bottom: 20px;
  margin-left: 60px;
}

.subtitle {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 10px;
}

.cta-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
}

.btn:active {
  transform: scale(0.97);
  filter: brightness(0.94);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: #ffffff;
  box-shadow: 0 8px 20px -6px #ff0029;
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--outline-btn-border);
  transition: all 1.8s var(--ease-soft);
}

/* Hover only on real pointer devices, so nothing gets "stuck" after a tap */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    box-shadow: 0 10px 24px -6px rgba(79,70,214,0.6);
  }
  .btn-secondary:hover {
    border-color: var(--accent-start);
  }
  .theme-toggle:hover {
    box-shadow: 0 0 0 0.15rem rgba(106,92,245,0.2);
  }
}

/* ========== STATS ========== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px;
  min-height: 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.45s var(--ease-soft) forwards;
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 0.04s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.09s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.14s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.19s; }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-online { color: #2ecc71; }
.status-offline { color: #ff0029; }
.stat-ping { 
  color: #ff0029; 
  font-size: 15px; 
}

/* ========== SECTION HEADINGS ========== */
.section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-margin-top: 84px; /* keeps sticky header clear of scroll targets */
}

.section-title {
  font-size: 18px;
  font-weight: 700;
}

.group-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 4px 0 -2px 2px;
}

/* ========== FEATURE CARDS ========== */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.45s var(--ease-soft) forwards;
}

.card-list .feature-card:nth-child(1) { animation-delay: 0.04s; }
.card-list .feature-card:nth-child(2) { animation-delay: 0.09s; }
.card-list .feature-card:nth-child(4) { animation-delay: 0.14s; }
.card-list .feature-card:nth-child(5) { animation-delay: 0.19s; }

.feature-card:active {
  transform: scale(0.985);
}

.feature-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--radius-sm);
  background: var(--icon-bg);
  color: var(--accent-start);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--theme-speed) var(--ease);
}

.feature-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.feature-title {
  font-size: 14.5px;
  font-weight: 600;
}

.feature-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

@media (hover: hover) and (pointer: fine) {
  .feature-card:hover {
    border-color: var(--accent-start);
  }
}

/* ========== HOW TO JOIN ========== */
.steps-grid {
  display: block;
  gap: 8px;
}

.step-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  min-height: 84px;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.45s var(--ease-soft) forwards;
  font-family: sans-serif;
}

.step-card:active {
  transform: scale(0.97);
}

.steps-grid .step-card:nth-child(1) { animation-delay: 0.04s; }
.steps-grid .step-card:nth-child(2) { animation-delay: 0.09s; }
.steps-grid .step-card:nth-child(3) { animation-delay: 0.14s; }

.step-num {
  font-size: 22px;
  font-weight: 1000;
  color: var(--accent-start);
}

.step-text {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-muted);
}

@media (hover: hover) and (pointer: fine) {
  .step-card:hover {
    border-color: var(--accent-start);
  }
}

/* ========== RULES ACCORDION ========== */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rules-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  margin-top: -15px;
}

/* Each rule is one unified box: header + collapsible body share the same card,
   so the box never looks mismatched or jumps in size. */
.rule-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.45s var(--ease-soft) forwards;
}

.accordion .rule-card:nth-of-type(1) { animation-delay: 0.04s; }
.accordion .rule-card:nth-of-type(2) { animation-delay: 0.09s; }
.accordion .rule-card:nth-of-type(3) { animation-delay: 0.14s; }

.accordion-item {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* strong picks up 700 weight by default; keep it matched to the button's own weight */
.accordion-item strong {
  font-weight: inherit;
}

.accordion-item:active {
  opacity: 0.7;
}

.chevron {
  color: var(--text-muted);
  transition: transform 0.35s var(--ease), color var(--theme-speed) var(--ease);
  flex-shrink: 0;
}

.rule-card.open .chevron {
  transform: rotate(180deg);
  color: var(--accent-start);
}

/* Real smooth height animation: grid-template-rows tweens from 0fr to 1fr,
   so the box resizes to fit its actual content with no guessed max-height. */
.accordion-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease);
}

.rule-card.open .accordion-wrap {
  grid-template-rows: 1fr;
}

.accordion-panel {
  min-height: 0;
  overflow: hidden;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0 16px;
  transition: padding 0.35s var(--ease);
}

.rule-card.open .accordion-panel {
  padding: 0 16px 16px;
}

/* ========== FOOTER ========== */
/* ===== FOOTER STYLES (reusable — copy this whole block onto other pages' stylesheets) ===== */
.site-footer {
  margin: 12px 20px 0;
  padding: 24px 4px 28px;
  border-top: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-logo {
  width: 28px;
  border-radius: 4px;
}

.footer-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.footer-links a {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

@media (hover: hover) and (pointer: fine) {
  .footer-links a:hover {
    color: var(--accent-start);
  }
}

.footer-copy {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.8;
  max-width: 320px;
  line-height: 1.5;
}
/* ===== END FOOTER STYLES ===== */

/* ========== BOTTOM NAV ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--nav-bg);
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: space-around;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  z-index: 9998;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 17px;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-item.active {
  color: var(--accent-start);
}

@media (hover: hover) and (pointer: fine) {
  .nav-item:hover {
    color: var(--accent-start);
  }
}

/* ========== RESPONSIVE (tablet / desktop) ========== */
@media (min-width: 600px) {
  .phone {
    max-width: 560px;
    padding-top: 12px;
  }
  .hero h1 { font-size: 32px; }
  .steps-grid { gap: 12px; }
}

@media (min-width: 900px) {
  body { padding: 24px 0; }
  .phone {
    max-width: 640px;
    border-radius: 28px;
    box-shadow: 0 30px 60px -20px rgba(0,0,0,0.25);
    overflow: hidden;
    min-height: auto;
  }
  .bottom-nav {
    position: sticky;
    max-width: 640px;
  }
}

/* Respect users who've asked for less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
