:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --text: #e8eef4;
  --muted: #9aabb8;
  --accent: #5b8def;
  --accent-soft: rgba(91, 141, 239, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--sans);
  background: radial-gradient(ellipse at 20% 0%, #1b2a44 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
}
header {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0;
}
.site-title {
  font-family: var(--serif);
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}
.site-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}
nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
}
nav button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s, background 0.25s, border-color 0.25s;
}
nav button:hover,
nav button.active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: rgba(91, 141, 239, 0.35);
}
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.tab-panel {
  display: none;
  animation: fadeIn 0.45s ease;
}
.tab-panel.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.3;
}
h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}
h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
  color: #c8d8ea;
}
h3 {
  font-size: 1.08rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--accent);
}
p {
  margin-bottom: 1rem;
  color: #d5dee8;
}
.lead {
  font-size: 1.08rem;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}
article {
  background: rgba(26, 35, 50, 0.55);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}
.meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2rem;
}
.canvas-wrap {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #06080c;
}
canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
}
.canvas-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 1rem 0;
}
.canvas-controls label {
  color: var(--muted);
  font-size: 0.9rem;
}
.canvas-controls input[type="range"] {
  width: 160px;
}
.canvas-controls button {
  border: 1px solid rgba(91, 141, 239, 0.4);
  background: var(--accent-soft);
  color: var(--text);
  font: inherit;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
}
footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}
@media (max-width: 640px) {
  h1 { font-size: 1.55rem; }
  article { padding: 1.1rem 1.15rem; }
}
