:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #666666;
  --accent: #1a1a1a;
  --border: #d0d0d0;
  --overlay: rgba(255, 255, 255, 0.75);
  --fog-color: #ffffff;
  --grid-color: #e0e0e0;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --fg: #eaeaea;
  --muted: #888888;
  --accent: #ffffff;
  --border: #333333;
  --overlay: rgba(10, 10, 10, 0.75);
  --fog-color: #0a0a0a;
  --grid-color: #111111;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  margin: 0;
  font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  transition: background 0.3s ease, color 0.3s ease;
}

.app {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

header {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

header h1 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  margin: 0;
  letter-spacing: 0.02em;
  font-weight: 600;
}

header .byline {
  margin: 0;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

header .byline a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

header .byline a:hover {
  border-bottom-color: var(--fg);
}

.spacer {
  flex: 1;
}

.btn,
label[for="files"] {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 0.5rem;
  font-size: 10px;
  transition: all 0.2s ease;
}

.btn:hover,
label[for="files"]:hover {
  background: var(--fg);
  color: var(--bg);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#theme-toggle {
  font-size: 12px;
  padding: 0.4rem 0.6rem;
  text-transform: none;
}

input[type="range"] {
  accent-color: var(--accent);
  width: 100%;
}

#wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.controls {
  position: fixed;
  right: 1rem;
  top: 5rem;
  display: grid;
  gap: 0.65rem;
  padding: 0.6rem;
  border: 0.5px solid var(--border);
  border-radius: 0;
  backdrop-filter: none;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  min-width: 160px;
}

.controls label {
  display: grid;
  gap: 0.3rem;
  margin: 0.2rem 0;
  font-size: 10px;
  color: var(--muted);
}

.controls label span {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.controls input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1px;
  background: var(--border);
  border-radius: 0;
  outline: none;
}

.controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 7px;
  height: 7px;
  border-radius: 0;
  border: 1px solid var(--fg);
  background: var(--bg);
  cursor: pointer;
}

.controls input[type="range"]::-moz-range-track {
  height: 1px;
  background: var(--border);
  border: none;
  border-radius: 0;
}

.controls input[type="range"]::-moz-range-thumb {
  width: 7px;
  height: 7px;
  border-radius: 0;
  border: 1px solid var(--fg);
  background: var(--bg);
  cursor: pointer;
}

.credits {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  color: var(--muted);
  font-size: 11px;
}

a {
  color: var(--fg);
}

