body {
  font-family: system-ui, sans-serif;
  margin: 0;
  background: #000; /* page background black */
  color: #fff; /* default text white */
  min-height: 100vh;
}

/* Header styling */
header, #site-header > header {
  background: #000; /* header matches page background */
  color: #fff;
  padding: 1rem clamp(1rem, 2vw, 2rem);
}

header h1,
#site-header > header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 2vw + 1rem, 2.25rem);
}

/* Navigation links */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

nav a {
  color: #fff;
  text-decoration: none;
}
nav a:visited { color: #ddd; }
nav a:hover, nav a:focus { color: #fff; text-decoration: underline; }

main {
  padding: clamp(1rem, 2.5vw, 2rem);
  background: transparent; /* let body black show through */
  color: #fff;
}

/* Form controls and buttons: make them dark with light text */
input, textarea, select, button {
  background: #111;
  color: #fff;
  border: 1px solid #333;
}
input::placeholder, textarea::placeholder { color: #999; }

/* Tables, lists, and other text elements */
table, th, td, p, li, h1, h2, h3, h4, h5, h6 {
  color: #fff;
}

/* Images keep their natural colors; ensure they don't have white backgrounds by default */
img { display: block; max-width: 100%; height: auto; }

/* SVG container for positioning overlay controls */
#svg-container { position: relative; }

/* Home button in the top-right of the graphic */
#home-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
}
#home-btn:hover { background: rgba(255,255,255,0.12); }

/* Triangle expand/collapse controls */
polygon.expand-triangle {
  transition: fill 0.2s ease;
}

polygon.expand-triangle:hover {
  filter: drop-shadow(0 0 3px rgba(255,255,255,0.5));
}

@media (max-width: 700px) {
  header h1,
  #site-header > header h1 {
    margin-bottom: 0.5rem;
  }

  nav {
    gap: 0.5rem 0.75rem;
  }

  #home-btn {
    right: 8px;
    bottom: 8px;
    padding: 0.45rem 0.7rem;
    font-size: 0.875rem;
  }
}
