:root {
  --bg: #0f1115;
  --panel: #171a21;
  --text: #e6e8ec;
  --muted: #9aa3af;
  --accent: #6ea8fe;
  --rule: #2a2f3a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* ---- Nav ---- */
header {
  border-bottom: 1px solid var(--rule);
  background: var(--panel);
}

nav {
  display: flex;
  gap: 4px;
  max-width: 820px;
  margin: 0 auto;
  padding: 10px 20px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
}

nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
nav a.active { color: var(--text); background: rgba(110, 168, 254, 0.15); }

/* ---- Main / canvas ---- */
main {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

#sim {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#sim[hidden] { display: none; }

#home-title {
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none; /* never block clicks on falling boxes */
  z-index: 1;
}

#home-title[hidden] { display: none; }

/* ---- Article / about content ---- */
#app {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

#app[hidden] { display: none; }

.content h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 0.6em; }
.content h2 { font-size: 1.4rem; margin: 1.6em 0 0.5em; }
.content h3 { font-size: 1.15rem; margin: 1.4em 0 0.4em; }
.content p { margin: 0 0 1.1em; }
.content a { color: var(--accent); }
.content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0.5em 0;
}

.back { margin-top: 2.5em; }
.back a { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--accent); }
