:root {
  --bg: #07090c;
  --ink: #f3f5f7;
  --ink-dim: rgba(243, 245, 247, 0.68);
  --glass: rgba(8, 11, 15, 0.55);
  --line: rgba(255, 255, 255, 0.14);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  overflow: hidden;
}

/* Fallback when WebGL is unavailable */
body.no-gl {
  background: linear-gradient(160deg, #0f2a4a, #3f7cc0 45%, #a9cbe8 70%, #e39b5b);
}

canvas#plates {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.card {
  position: fixed;
  /* card centre at ~80% / 80% of the viewport, clamped to stay 16px inside the edges */
  left: 0;
  top: 0;
  transform: translate(
    max(16px, min(80vw - 50%, 100vw - 100% - 16px)),
    max(16px, min(80vh - 50%, 100vh - 100% - 16px))
  );
  transform: translate(
    max(16px, min(80vw - 50%, 100vw - 100% - 16px)),
    max(16px, min(80dvh - 50%, 100dvh - 100% - 16px))
  );
  padding: 28px 36px 26px;
  max-width: calc(100vw - 32px);
  text-align: center;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 14px;
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.card h1 {
  margin: 0 0 10px;
  font-size: clamp(24px, 5vw, 38px);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.card p { margin: 0; color: var(--ink-dim); letter-spacing: 0.04em; }
.card .kvk span { font-variant-numeric: tabular-nums; }
.card a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.card a:hover, .card a:focus-visible { border-bottom-color: var(--ink); outline: none; }

.tune {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0.55;
  transition: opacity 0.2s;
}
.tune[hidden] { display: none; }
.tune:hover, .tune:focus-visible, .tune[aria-expanded="true"] { opacity: 1; color: var(--ink); }

.panel {
  position: fixed;
  right: 16px;
  bottom: 64px;
  width: min(320px, calc(100vw - 32px));
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  padding: 14px 16px;
  font-size: 13px;
  background: rgba(10, 13, 18, 0.82);
  border: 1px solid var(--line);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.panel[hidden] { display: none; }
.panel header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.panel .hint { margin: 0 0 10px; color: var(--ink-dim); font-size: 12px; line-height: 1.4; }

.swatch {
  display: grid;
  grid-template-columns: 34px 1fr 40px;
  gap: 10px;
  align-items: center;
  margin: 6px 0;
}
.swatch output { text-align: right; color: var(--ink-dim); font-variant-numeric: tabular-nums; }

.row {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
  color: var(--ink-dim);
}
.row input[type="color"] { justify-self: start; }

input[type="range"] { width: 100%; accent-color: #9fc1e3; }
input[type="color"] {
  width: 34px; height: 26px; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer;
}
select, .panel button {
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 9px;
  cursor: pointer;
}
.panel footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
