/* gamersgrave.net — modern approachable gaming community theme */

:root {
  /* Dark neutrals — matched to original gamersgrave.net */
  --bg: #070707;
  --bg-elevated: #120808;
  --bg-card: #1b0503;
  --bg-hover: #270804;
  --border: #830000;
  --border-subtle: #3a1010;

  /* Text */
  --text: #f0f0f0;
  --text-muted: #c4b0b0;
  --text-faint: #8a6a6a;

  /* Accent — original blood red */
  --accent: #af0003;
  --accent-hover: #ff5730;
  --accent-muted: rgba(175, 0, 3, 0.18);
  --accent-border: rgba(175, 0, 3, 0.45);
  --accent-on: #f0f0f0;

  /* Focus / links */
  --focus: #ff5730;
  --link: #af0003;
  --link-hover: #ff5730;

  /* Layout */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --max: 1100px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  /* Black until the 3D globe fades in (PNG only for no-webgl fallback) */
  background-color: #000000;
  background-image: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
  vertical-align: middle;
}

a {
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

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

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

/* —— Skip link —— */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* —— Site shell —— */
.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 7, 7, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand:hover .brand-name {
  color: var(--accent);
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--accent-border);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.2;
}

.brand-name {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.brand-tagline {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-faint);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.925rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-hover);
  text-decoration: none;
}

.nav-link[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-muted);
}

.nav-link--external {
  color: var(--text-muted);
}

.nav-link--cta {
  margin-left: 0.25rem;
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
}

.nav-link--cta:hover {
  background: var(--accent-hover);
  color: var(--accent-on);
  text-decoration: none;
}

/* —— Hero / page intro —— */
.page-hero {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.page-hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-hero .lede {
  margin: 0;
  max-width: 36rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.tag-pill {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* —— Layout: main + sidebar —— */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2rem 0 3rem;
  flex: 1;
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 2.5rem;
    align-items: start;
  }

  .layout--with-toc {
    grid-template-columns: 200px minmax(0, 1fr) 260px;
  }

  .layout--simple {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

.main-col {
  min-width: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.sidebar-card h2 {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.sidebar-card p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.sidebar-card p:last-child {
  margin-bottom: 0;
}

/* —— TOC / news index —— */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.toc h2 {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.toc ol,
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: 0.4rem 0.6rem;
  margin: 0 -0.35rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent);
  background: var(--accent-muted);
  text-decoration: none;
}

@media (max-width: 899px) {
  .toc {
    display: none;
  }

  .layout--with-toc .toc {
    display: block;
  }

  .toc ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .toc a {
    padding: 0.35rem 0.65rem;
    background: var(--bg-hover);
    font-size: 0.8rem;
  }
}

/* —— News cards —— */
.news-feed {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  scroll-margin-top: 5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.news-card:hover {
  border-color: var(--accent-border);
}

.news-card h2 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
}

.news-card p {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  font-size: 0.95rem;
}

.news-card p:last-of-type {
  margin-bottom: 0;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-faint);
}

.news-meta .author {
  font-weight: 600;
  color: var(--text-muted);
}

/* —— Content sections (About, Team) —— */
.content-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.65rem;
  margin-bottom: 1.25rem;
  scroll-margin-top: 5rem;
}

.content-block:last-child {
  margin-bottom: 0;
}

.content-block h2 {
  margin: 0 0 0.85rem;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}

.content-block p {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.975rem;
}

.content-block p:last-child {
  margin-bottom: 0;
}

.domain-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.domain-list li a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-decoration: none;
}

.domain-list li a:hover {
  border-color: var(--accent-border);
  background: var(--accent-muted);
  text-decoration: none;
}

/* —— Team cards —— */
.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
}

@media (min-width: 520px) {
  .team-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.team-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

a.team-card:hover {
  border-color: var(--accent-border);
  background: var(--accent-muted);
  text-decoration: none;
}

.team-nick {
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text);
}

a.team-card:hover .team-nick {
  color: var(--accent);
}

.team-role {
  font-size: 0.85rem;
  color: var(--text-faint);
  font-style: normal;
  line-height: 1.4;
}

.team-placeholder {
  padding: 1rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.team-placeholder strong {
  color: var(--text);
}

/* —— Live server status —— */
.server-status-meta {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.server-status {
  min-height: 2rem;
}

.server-status-msg {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.server-status-msg--loading {
  border-style: solid;
  border-color: var(--accent-border);
  background: var(--accent-muted);
  color: var(--text);
}

.server-status-msg--error {
  border-style: solid;
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.08);
  color: #ffb4b4;
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.server-card {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.server-card.is-online {
  border-color: rgba(34, 197, 94, 0.45);
}

.server-card.is-offline {
  opacity: 0.9;
  border-color: rgba(255, 107, 107, 0.35);
}

.server-card-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.server-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}

.server-card.is-online .server-dot {
  background: #22c55e;
  box-shadow:
    0 0 6px 2px rgba(34, 197, 94, 0.85),
    0 0 14px 4px rgba(34, 197, 94, 0.45);
  /* duration/delay randomized per-dot in JS so cards don't sync */
  animation: server-dot-online-flicker 2.4s ease-in-out infinite;
}

.server-card.is-offline .server-dot {
  background: #ff6b6b;
  box-shadow:
    0 0 6px 2px rgba(255, 107, 107, 0.75),
    0 0 14px 4px rgba(255, 107, 107, 0.35);
  /* mostly steady; sparse natural bulb dips — duration/delay randomized in JS */
  animation: server-dot-offline-flicker 7s steps(1, end) infinite;
}

/* Subtle green intensity wobble — still clearly "on" */
@keyframes server-dot-online-flicker {
  0%,
  100% {
    opacity: 1;
    filter: brightness(1);
    box-shadow:
      0 0 6px 2px rgba(34, 197, 94, 0.85),
      0 0 14px 4px rgba(34, 197, 94, 0.45);
  }
  12% {
    opacity: 0.92;
    filter: brightness(0.95);
    box-shadow:
      0 0 5px 1px rgba(34, 197, 94, 0.7),
      0 0 11px 3px rgba(34, 197, 94, 0.35);
  }
  18% {
    opacity: 1;
    filter: brightness(1.08);
    box-shadow:
      0 0 8px 3px rgba(34, 197, 94, 0.95),
      0 0 16px 5px rgba(34, 197, 94, 0.5);
  }
  41% {
    opacity: 0.88;
    filter: brightness(0.9);
    box-shadow:
      0 0 4px 1px rgba(34, 197, 94, 0.6),
      0 0 10px 3px rgba(34, 197, 94, 0.3);
  }
  47% {
    opacity: 1;
    filter: brightness(1.05);
    box-shadow:
      0 0 7px 2px rgba(34, 197, 94, 0.9),
      0 0 15px 4px rgba(34, 197, 94, 0.48);
  }
  73% {
    opacity: 0.94;
    filter: brightness(0.96);
    box-shadow:
      0 0 5px 2px rgba(34, 197, 94, 0.75),
      0 0 12px 3px rgba(34, 197, 94, 0.38);
  }
  81% {
    opacity: 1;
    filter: brightness(1.06);
    box-shadow:
      0 0 8px 2px rgba(34, 197, 94, 0.92),
      0 0 16px 5px rgba(34, 197, 94, 0.5);
  }
}

/* Flaky bulb: long steady glow, occasional irregular dips (natural, infrequent) */
@keyframes server-dot-offline-flicker {
  0%,
  100% {
    opacity: 1;
    filter: brightness(1);
    box-shadow:
      0 0 6px 2px rgba(255, 107, 107, 0.75),
      0 0 14px 4px rgba(255, 107, 107, 0.35);
  }
  38% {
    opacity: 1;
    filter: brightness(1);
    box-shadow:
      0 0 6px 2px rgba(255, 107, 107, 0.75),
      0 0 14px 4px rgba(255, 107, 107, 0.35);
  }
  40% {
    opacity: 0.45;
    filter: brightness(0.55);
    box-shadow:
      0 0 3px 1px rgba(255, 107, 107, 0.35),
      0 0 6px 2px rgba(255, 107, 107, 0.15);
  }
  42% {
    opacity: 1;
    filter: brightness(1.05);
    box-shadow:
      0 0 7px 2px rgba(255, 107, 107, 0.85),
      0 0 15px 4px rgba(255, 107, 107, 0.4);
  }
  71% {
    opacity: 1;
    filter: brightness(1);
    box-shadow:
      0 0 6px 2px rgba(255, 107, 107, 0.75),
      0 0 14px 4px rgba(255, 107, 107, 0.35);
  }
  72% {
    opacity: 0.08;
    filter: brightness(0.12);
    box-shadow: 0 0 1px 0 rgba(255, 107, 107, 0.1);
  }
  73.5% {
    opacity: 0.75;
    filter: brightness(0.9);
    box-shadow:
      0 0 5px 2px rgba(255, 107, 107, 0.55),
      0 0 10px 3px rgba(255, 107, 107, 0.25);
  }
  74.5% {
    opacity: 0.15;
    filter: brightness(0.25);
    box-shadow: 0 0 2px 0 rgba(255, 107, 107, 0.12);
  }
  76% {
    opacity: 1;
    filter: brightness(1.1);
    box-shadow:
      0 0 8px 3px rgba(255, 107, 107, 0.9),
      0 0 16px 5px rgba(255, 107, 107, 0.45);
  }
  88% {
    opacity: 1;
    filter: brightness(1);
    box-shadow:
      0 0 6px 2px rgba(255, 107, 107, 0.75),
      0 0 14px 4px rgba(255, 107, 107, 0.35);
  }
  91% {
    opacity: 0.65;
    filter: brightness(0.75);
    box-shadow:
      0 0 4px 1px rgba(255, 107, 107, 0.45),
      0 0 8px 2px rgba(255, 107, 107, 0.2);
  }
  93% {
    opacity: 1;
    filter: brightness(1);
    box-shadow:
      0 0 6px 2px rgba(255, 107, 107, 0.75),
      0 0 14px 4px rgba(255, 107, 107, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .server-card.is-online .server-dot,
  .server-card.is-offline .server-dot {
    animation: none !important;
    filter: none;
  }
}

.server-status-label {
  color: var(--text-muted);
}

.server-card.is-online .server-status-label {
  color: #4ade80;
}

.server-card.is-offline .server-status-label {
  color: #ffb4b4;
}

.server-players {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}

.server-name {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.server-map,
.server-connect,
.server-error {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
}

.server-meta-label {
  color: var(--text-faint);
  font-weight: 500;
}

.server-connect code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-hover);
  background: var(--accent-muted);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.server-error {
  color: #ffb4b4;
  font-size: 0.72rem;
}

/* —— Media —— */
.media-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: var(--shadow);
}

.media-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.media-featured {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.media-credit {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.media-description {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
}

/* —— Buttons / CTAs —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-on);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-faint);
  background: var(--bg-hover);
  text-decoration: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.link-button-img {
  display: inline-block;
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.link-button-img:hover {
  opacity: 1;
}

/* —— Footer —— */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  padding: 1.75rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

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

.footer-links a:hover {
  color: var(--accent);
}

/* —— Utilities —— */
.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;
}

/* —— Mobile nav tweaks —— */
@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
    gap: 0.2rem;
  }

  .nav-link {
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
  }

  .nav-link--cta {
    margin-left: 0;
  }

  .brand-tagline {
    display: none;
  }

  .page-hero {
    padding: 1.5rem 0 1.25rem;
  }

  .news-card,
  .content-block {
    padding: 1.15rem 1.2rem;
  }

  .layout {
    padding: 1.5rem 0 2.5rem;
    gap: 1.5rem;
  }
}


/* —— Interactive 3D globe background —— */
#globe-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: auto;
  overflow: hidden;
}

#globe-bg canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.4s ease;
  /* whisper of red bloom; material opacity does the randomized blink */
  filter: drop-shadow(0 0 22px rgba(175, 0, 3, 0.14));
}

#globe-bg.is-ready canvas {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  #globe-bg canvas {
    transition: none;
  }
}

/* When WebGL globe is running, drop the static PNG (canvas is the bg) */
body.globe-active {
  background-image: none;
  background-color: #000000;
}

/* Let pointer events fall through empty page chrome to the globe canvas
   so drag-to-orbit works in the margins while cards/nav stay clickable. */
body.globe-active .site {
  position: relative;
  z-index: 1;
  pointer-events: none;
  background: transparent;
}

body.globe-active .site-header,
body.globe-active .container,
body.globe-active .site-footer,
body.globe-active .skip-link {
  pointer-events: auto;
}

/* Fallback: keep the original PNG when WebGL is unavailable */
body.no-webgl {
  background-color: var(--bg);
  background-image: url("../assets/globetransparent.png");
  background-repeat: no-repeat;
  background-position: bottom right;
  background-size: cover;
  background-attachment: fixed;
}

/* Mobile: never steal scroll/gestures; keep globe as decorative backdrop */
@media (max-width: 768px) {
  #globe-bg {
    pointer-events: none;
  }

  #globe-bg canvas {
    /* drop-shadow is expensive on mobile GPUs */
    filter: none;
  }

  body.globe-active .site {
    pointer-events: auto;
  }

  body.no-webgl {
    /* iOS struggles with fixed backgrounds */
    background-attachment: scroll;
    background-position: center bottom;
    background-size: 140% auto;
  }
}

/* prefers-reduced-motion: auto-rotate disabled in globe-bg.js */
