:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg-color: #111119;
  --text-color: rgba(255, 255, 255, 0.9);
  --text-muted: rgba(255, 255, 255, 0.6);
  --accent: #646cff;
  --panel-bg: rgba(22, 25, 34, 0.8);
  --border-color: rgba(255, 255, 255, 0.1);
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: #0a0a0a;
  background-image: url('assets/bg.png');
  background-size: cover;
  background-attachment: fixed;
  background-blend-mode: normal;
  color: #e0e0e0;
  line-height: 1.6;
}

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  margin-bottom: 3rem;
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #fff, #aaa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

article {
  background: var(--panel-bg);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

h2 {
  margin-top: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  color: #fff;
}

p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.applet-container {
  margin: 2rem -2rem;
  background: #000;
  position: relative;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background-color: var(--border-color);
  /* Gap color */
  height: 500px;
}

.canvas-wrapper {
  background: #050505;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.canvas-wrapper h3 {
  position: absolute;
  top: 10px;
  left: 10px;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 8px;
  border-radius: 4px;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.controls {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover {
  color: #fff;
}

code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: monospace;
}

@media (max-width: 700px) {
  .applet-container {
    grid-template-columns: 1fr;
    height: auto;
  }

  .canvas-wrapper {
    height: 300px;
  }
}