/* ========== MooseNet Global Styles ========== */

:root {
  --bg:#0b0f0d;
  --panel:#101613;
  --ink:#e6efe9;
  --muted:#a7b5ad;
  --moss:#2d4a3a;
  --moss-2:#3a5f4b;
  --accent:#89a38f;
  --ring:#1a2a23;
  --card:#121a16;
  --brand:#cfe2d7;
  --focus:#9cc5b1;
  --link:#a0d1bd;
  --red:#FF0000;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 70% -10%, #132018 0%, #0c1411 45%, var(--bg) 75%) fixed;
  color: var(--ink);
  font-family: "Titillium Web", system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Anti-copy friction (CSS half – JS lives in pages) */
html.nocopy,
body.nocopy,
.nocopy .wrap {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

::selection {
  background: transparent;
}

/* Utility */

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

/* ========== Header / Brand ========== */

.header {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-start;
  padding: 12px 16px;
  border: 1px solid var(--ring);
  background: linear-gradient(180deg, var(--panel), #0e1512);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .02);
}

.brand {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
}

.brand img {
  max-height: 110px;
  width: auto;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .35));
}

.brand-footer .wordmark {
  max-height: 250px;
  width: auto;
  opacity: 0.5;
  margin: 0 auto;
}

.ticker {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  border-left: 1px solid var(--ring);
  padding-left: 10px;
  color: var(--muted);
  font-family: "Rajdhani", sans-serif;
  letter-spacing: .3px;
  min-width: 0;
}

.ticker span {
  display: inline-block;
  animation: ticker 10s linear infinite;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ========== Hero ========== */

.hero {
  position: relative;
  margin-top: 22px;
  border-radius: 18px;
  padding: 48px 24px;
  text-align: center;
  border: 1px solid var(--ring);
  background: linear-gradient(180deg, rgba(25, 40, 33, .65), rgba(12, 18, 15, .85));
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: .18;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0 0 8px 0;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: .6px;
  font-size: clamp(28px, 3.6vw, 46px);
}

.hero p {
  margin: 0 auto;
  color: var(--brand);
  max-width: 720px;
}

.hero-cta {
  margin-top: 14px;
}

/* ========== Media / Grid / Cards ========== */

.media {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #0c1210;
  border: 1px solid #0b120f;
  aspect-ratio: 1 / 1;
}

.media > img.fit-cover,
.media > img.fit-contain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.media > img.fit-cover {
  object-fit: cover;
}

.media > img.fit-contain {
  object-fit: contain;
  background: #0e1512;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.card {
  background: linear-gradient(180deg, var(--card), #0e1512);
  border: 1px solid var(--ring);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .35);
}

.card-title {
  margin: 2px 0 8px 0;
  font-family: "Rajdhani", sans-serif;
}

.card p {
  color: var(--muted);
}

/* ========== Buttons & CTA ========== */

.cta {
  display: flex;
  justify-content: center;
  margin: 22px 0 8px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--ring);
  background: linear-gradient(180deg, #132019, #0d1613);
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  cursor: pointer;
  transition: filter .15s ease-out, transform .15s ease-out;
}

.btn:hover {
  filter: brightness(1.6);
  transform: translateY(-1px);
}

.btn-active {
  filter: brightness(3.06);
}

.help-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 12px 55px;
  border-radius: 10px;
  background: linear-gradient(180deg, #132019, #0d1613);
  color: var(--link);
  font-weight: 400;
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  transition: background .2s ease, transform .15s ease, text-shadow .2s ease;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.help-button:hover {
  background: rgba(255,255,255,0.10);
  transform: translateY(-2px);
  text-shadow: 0 0 6px var(--link);
}

.join-button {
  display: inline-flex;
  align-items: center;
  padding: 1px 55px;
  margin-top: .5rem;
  border-radius: 10px;
  background: linear-gradient(180deg, #132019, #0d1613);
  color: var(--link);
  text-decoration: none;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  transition: background 0.2s ease, transform 0.15s ease;
}

.join-button:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

/* ========== Free Help ========== */
.help {
  width: 100%;
  text-align: center;
  margin: 20px 0;
}
/* ========== Pricing ========== */

.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 26px 0;
}

.tier {
  background: linear-gradient(180deg, #122019, #0f1714);
  border: 1px solid var(--ring);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tier::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(500px 180px at 50% -100px, rgba(137, 163, 143, .22), transparent 60%);
}

.tier h3 {
  font-family: "Rajdhani", sans-serif;
  margin: 4px 0 6px 0;
}

.price {
  font-size: 34px;
  font-weight: 700;
  color: var(--brand);
  margin: 2px 0;
}

.per {
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--moss-2);
  color: #0d140f;
  font-weight: 700;
}

/* ========== Donations ========== */

.donos {
  text-align: center;
  margin: 22px 0;
}

.donos-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ========== Center Wrapper========= */
.join-wrapper {
  text-align: center;
  margin-top: 1.5rem;
}

/* ========== Footer ========== */

footer {
  margin: 24px 0 16px 0;
  color: var(--muted);
  text-align: center;
}

.meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.abuse-badge {
  max-width: 150px;
  border-radius: 5px;
  border: 5px solid #111;
  padding: 5px;
  background: #FF8C00;
  box-shadow: 2px 2px 1px 1px rgba(0, 0, 0, .2);
  opacity: 0.8;
}

/* Hidden heading helper for accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== Terms Page ========== */

body.terms-page {
  background-image: url("https://moosenet.lol/web_images/MooseCyber.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: #ffffff;
}

.page-header {
  padding: 12px 16px;
}

.page-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.return-link {
  color: var(--ink);
  font-weight: 600;
}

.return-link.secondary {
  display: inline-block;
  margin-top: 8px;
}

.terms-main {
  max-width: 1100px;
  margin: 0 auto 40px auto;
  padding: 0 16px 32px 16px;
  display: grid;
  grid-template-columns: minmax(0, 2.5fr) minmax(0, 1.5fr);
  gap: 24px;
}

.terms-panel {
  background: rgba(0, 0, 0, 0.82);
  border-radius: 16px;
  padding: 24px 22px 26px 22px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
}

.terms-heading h1 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 10px;
  font-family: "Rajdhani", sans-serif;
}

.terms-intro {
  text-align: center;
  margin-top: 0;
  margin-bottom: 18px;
}

.terms-list {
  list-style: decimal;
  margin: 0 0 8px 20px;
  padding: 0;
}

.terms-list > li {
  margin-bottom: 16px;
}

.terms-list h2 {
  font-size: 1.05rem;
  margin: 0 0 4px 0;
  font-family: "Rajdhani", sans-serif;
}

.terms-list p {
  margin: 0 0 6px 0;
  font-size: 0.98rem;
}

.terms-footer {
  margin-top: 12px;
  text-align: center;
  font-size: 0.95rem;
}

.terms-logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
}

.terms-logo {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

/* ========== Responsive tweaks ========== */

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ticker {
    border-left: none;
    border-top: 1px solid var(--ring);
    padding-left: 0;
    padding-top: 6px;
  }

  .wrap {
    padding: 16px;
  }

  .terms-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .terms-logo-section {
    display: none;
  }
}

/* ========== Menu (Pinned Toggle + Scrollable Drawer) ========== */

/* Keep the Menu button pinned top-right while scrolling (mobile + desktop) */
.menu-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 950;
}

/* When menu is open, prevent background page scroll */
body.menu-open {
  overflow: hidden;
}

/* Ensure the overlay fills the viewport on all screen sizes */
.menu-panel {
  position: fixed;
  inset: 0;
  z-index: 900;
}

/* Drawer scrolls if content exceeds viewport height */
.menu-panel-inner {
  max-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Keep the close button accessible while scrolling inside the drawer */
.menu-close {
  position: sticky;
  top: 0;
  float: none;
  display: flex;
  justify-content: flex-end;
  padding: 0;
  margin: -4px -4px 8px 0;
  background: linear-gradient(180deg, rgba(16,22,19,0.98), rgba(16,22,19,0.85));
  backdrop-filter: blur(2px);
}

/* Optional: give the drawer a little breathing room on very short screens */
@media (max-height: 520px) {
  .menu-panel-inner {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

/* ========== Sticky Header (keep the whole top bar visible while scrolling) ========== */

/* Keep the entire header (logo + ticker + menu button) stuck to the top while scrolling */
.header {
  position: sticky;
  top: 12px;            /* respects .wrap padding so it doesn't glue to the very edge */
  z-index: 960;         /* above content, below the menu overlay */
}

/* Make the header look intentional while it's floating */
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(16, 22, 19, 0.92);
  backdrop-filter: blur(6px);
  z-index: -1;
}

/* Pin the menu button to the header (not the viewport) so it moves with the header */
.menu-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
}

/* Ensure header layout still works with absolute-positioned menu button */
.header {
  position: sticky;
}

/* ========== Flush Layout + Sticky Header (Edge-to-Edge) ========== */

/* Make the overall layout flush to the viewport edges */
.wrap {
  max-width: 1100px;   /* keep readable width on desktop */
  margin: 0 auto;
  padding: 0;          /* REMOVE side inset */
}

/* Header should hug the top edge while scrolling */
.header {
  position: sticky;
  top: 0;
  z-index: 1200;
  border-radius: 0;    /* edge-to-edge feel */
}

/* Make the sticky header's backing blend cleanly at the top edge */
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(16, 22, 19, 0.92);
  backdrop-filter: blur(6px);
  z-index: -1;
}

/* Keep the menu button in the top-right of the header */
.menu-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
}

/* Ensure sections/cards still have breathing room even when wrap padding is 0 */
.hero,
.grid,
.donos,
.pricing,
.join-wrapper,
.help,
footer {
  padding-left: 16px;
  padding-right: 16px;
}

/* On larger screens, restore a bit more breathing room */
@media (min-width: 900px) {
  .hero,
  .grid,
  .donos,
  .pricing,
  .join-wrapper,
  .help,
  footer {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* ========== Menu Overlay: Front of Everything + Centered on Mobile ========== */

/* Make sure overlay is always above everything */
.menu-panel {
  z-index: 5000;
  align-items: flex-start;   /* default desktop behavior */
  justify-content: flex-end;
  padding: 0;
}

/* Drawer: keep within viewport and scroll if needed */
.menu-panel-inner {
  max-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mobile: center the drawer */
@media (max-width: 768px) {
  .menu-panel {
    align-items: center;
    justify-content: center;
    padding: 18px;
  }

  .menu-panel-inner {
    width: min(92vw, 360px);
    border-radius: 16px;
    border-left: none;
    border: 1px solid #1a2a23;
  }
}

/* ========== Menu Overlay Fixes (Front-most + Mobile Fit) ========== */

/* Keep header below modal overlay */
.header { z-index: 1000; }

/* Force the menu overlay above everything (including sticky header/backdrops) */
.menu-panel {
  z-index: 9999 !important;
}

/* Mobile: center the drawer AND guarantee it fits on-screen */
@media (max-width: 900px) {
  .menu-panel {
    align-items: center !important;
    justify-content: center !important;
    padding: calc(max(18px, env(safe-area-inset-top, 0px) + 12px)) 18px 18px 18px;
  }

  .menu-panel-inner {
    width: min(92vw, 360px) !important;
    max-width: 92vw !important;
    max-height: calc(100vh - 36px) !important;
    margin: 0 auto !important;
    border-radius: 16px !important;
    border-left: none !important;
    border: 1px solid #1a2a23 !important;
  }
}

/* Ensure the drawer never renders partially offscreen on very narrow devices */
.menu-panel-inner {
  box-sizing: border-box;
}

/* ========== Freeze Header (Fixed, Always Visible) ========== */

/* The header is truly frozen: fixed to viewport, not dependent on scroll direction */
.header {
  position: fixed !important;
  top: 0 !important;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1100;
  border-radius: 0;
  margin: 0;
}

/* Ensure content starts below the fixed header */
:root { --header-h: 0px; }

main#main {
  padding-top: var(--header-h);
}

/* Also give the wrapper breathing room below the header */
.wrap {
  padding-top: 0;
}
