:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #121214;
  --line: #26262a;
  --text: #f5f5f7;
  --accent: #f5f5f7;
  --menu: #0a0a0b;
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; color: inherit; }

.nav {
  position: sticky; top: 12px; z-index: 10;
  display: flex; justify-content: center; margin: 12px 0 0;
  pointer-events: none;
}
.nav .capsule {
  pointer-events: auto;
  display: flex; align-items: center; gap: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px;
}
.nav a { padding: 7px 14px; border-radius: 999px; font-weight: 600; letter-spacing: -0.01em; }
.nav a.brand { display: flex; align-items: center; gap: 8px; }
.nav a.here { background: #222226; }
.nav svg { width: 18px; height: 18px; }

main { width: min(1680px, 100%); margin: 0 auto; padding: 28px 16px 48px; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 600; letter-spacing: -0.025em; margin: 8px 0 24px; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); corner-shape: squircle;
}
@supports (corner-shape: squircle) { :root { --radius: 34px; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 14px; padding: 20px; transition: transform .15s; }
.tile:hover { transform: translateY(-2px); }
.tile .icon {
  width: 52px; height: 52px; border-radius: 14px; corner-shape: squircle;
  background: linear-gradient(160deg, #0f3a1c, #04120a); border: 1px solid #1d5a30;
  display: grid; place-items: center;
}
.tile .icon svg { width: 28px; height: 28px; }
.tile b { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: #1c1c1f; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.btn:hover { background: #26262a; }
.btn.primary { background: var(--accent); color: #000; border-color: var(--accent); }
.btn.primary:hover { background: #fff; }
.btn svg { width: 16px; height: 16px; }

/* dropdowns and sliders (ui.js) */
.dd {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--menu); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 10px 4px 12px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.dd:hover { background: #161618; }
.dd svg { width: 12px; height: 12px; flex: none; }
.dd-menu {
  position: fixed; z-index: 100; display: grid; gap: 2px; padding: 5px;
  max-height: 60vh; overflow: auto;
  background: var(--menu); border: 1px solid var(--line);
  border-radius: 16px; corner-shape: squircle;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .65);
}
.dd-menu button {
  text-align: left; background: none; border: 0; border-radius: 10px;
  padding: 7px 12px; cursor: pointer; font-weight: 500; white-space: nowrap;
}
.dd-menu button:hover { background: #1c1c1f; }
.dd-menu button.on { background: var(--text); color: #000; }
input.range { -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; --p: 50%; }
input.range:focus { outline: none; }
input.range::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(to right, var(--text) var(--p), #3a3a3e var(--p)); }
input.range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .55); }
input.range::-moz-range-track { height: 4px; border-radius: 999px; background: #3a3a3e; }
input.range::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--text); }
input.range::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .55); }
input.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(245, 245, 247, .35); }
