/* === Tweaks panel === */
.tw-panel {
  position: fixed; right: 16px; bottom: 16px;
  z-index: 2147483646;
  width: 300px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column;
  background: rgba(20, 18, 16, 0.92);
  color: #f3efe6;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  font: 11.5px/1.4 ui-sans-serif, system-ui, sans-serif;
  overflow: hidden;
}
.tw-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.tw-head b { font: 600 12px/1 ui-sans-serif; letter-spacing: 0.04em; }
.tw-x { appearance: none; border: 0; background: transparent; color: rgba(255,255,255,0.5); width: 24px; height: 24px; border-radius: 6px; cursor: none; font-size: 16px; }
.tw-x:hover { background: rgba(255,255,255,0.08); color: #fff; }
.tw-body { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent; }
.tw-body::-webkit-scrollbar { width: 6px; }
.tw-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.tw-sect { font-size: 9px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-top: 8px; padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.tw-sect:first-child { margin-top: 0; }
.tw-row { display: flex; flex-direction: column; gap: 6px; }
.tw-row-h { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.tw-lbl { display: flex; justify-content: space-between; align-items: baseline; color: rgba(255,255,255,0.7); font-weight: 500; }
.tw-val { color: rgba(255,255,255,0.4); font-variant-numeric: tabular-nums; font-size: 10px; font-family: var(--mono); }
.tw-swatches { display: flex; gap: 6px; }
.tw-sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: none; padding: 0; transition: transform 0.15s, border-color 0.15s; }
.tw-sw:hover { transform: scale(1.1); }
.tw-sw.on { border-color: #fff; }
.tw-select { background: rgba(255,255,255,0.06); color: #fff; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 4px 8px; font: inherit; cursor: none; }
.tw-radio { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 3px; background: rgba(255,255,255,0.04); padding: 2px; border-radius: 6px; }
.tw-radio button { background: transparent; border: 0; color: rgba(255,255,255,0.6); padding: 5px 6px; border-radius: 4px; cursor: none; font: inherit; }
.tw-radio button.on { background: rgba(255,255,255,0.12); color: #fff; }
.tw-range { width: 100%; accent-color: var(--accent); cursor: none; }
.tw-toggle { width: 36px; height: 20px; border-radius: 10px; background: rgba(255,255,255,0.1); border: 0; cursor: none; position: relative; padding: 0; transition: background 0.2s; }
.tw-toggle.on { background: var(--accent); }
.tw-toggle span { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left 0.2s; }
.tw-toggle.on span { left: 18px; }

[data-theme="light"] .tw-panel { background: rgba(245,240,230,0.92); color: #1a1815; border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .tw-head { border-bottom-color: rgba(0,0,0,0.06); }
[data-theme="light"] .tw-x { color: rgba(0,0,0,0.5); }
[data-theme="light"] .tw-x:hover { background: rgba(0,0,0,0.06); color: #000; }
[data-theme="light"] .tw-sect { color: rgba(0,0,0,0.4); border-bottom-color: rgba(0,0,0,0.06); }
[data-theme="light"] .tw-lbl { color: rgba(0,0,0,0.7); }
[data-theme="light"] .tw-val { color: rgba(0,0,0,0.4); }
[data-theme="light"] .tw-select { background: rgba(0,0,0,0.04); color: #000; border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .tw-radio { background: rgba(0,0,0,0.04); }
[data-theme="light"] .tw-radio button { color: rgba(0,0,0,0.6); }
[data-theme="light"] .tw-radio button.on { background: rgba(0,0,0,0.08); color: #000; }
[data-theme="light"] .tw-toggle { background: rgba(0,0,0,0.1); }
[data-theme="light"] .tw-toggle.on span { background: #fff; }

/* hide stuff conditionally */
body.no-cursor { cursor: auto; }
body.no-cursor .cursor-dot, body.no-cursor .cursor-ring { display: none; }
body.no-mesh .mesh { display: none; }

/* === 3D scroll & parallax === */
.tilt-3d {
  transform-style: preserve-3d;
  perspective: 1200px;
  will-change: transform;
}
.tilt-3d-inner {
  transition: transform 0.4s cubic-bezier(0.2,0.8,0.2,1);
  transform-style: preserve-3d;
}
body.no-3d .tilt-3d-inner { transform: none !important; }

[data-parallax] { will-change: transform; }
[data-depth] { will-change: transform; }

/* parallax-stack pinned section */
.parallax-stack {
  position: relative;
  height: 360vh;
}
.parallax-stack-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.parallax-stack-scene {
  position: relative;
  width: min(900px, 90vw);
  height: 70vh;
  transform-style: preserve-3d;
  perspective: 1400px;
}
.ps-card {
  position: absolute; inset: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5);
  will-change: transform, opacity;
}
.ps-card-num { font-family: var(--mono); font-size: 11px; color: var(--fg-mute); letter-spacing: 0.16em; }
.ps-card-h { font-family: var(--serif); font-size: clamp(40px, 6vw, 72px); line-height: 1.05; letter-spacing: -0.02em; max-width: 16ch; }
.ps-card-h em { font-style: italic; color: var(--accent); }
.ps-card-foot { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); letter-spacing: 0.08em; }
