:root {
  --bg: #0b0b10;
  --ink: #ece7db;
  --ink-dim: #8b8898;
  --line: rgba(236, 231, 219, 0.12);
  --panel-bg: rgba(16, 16, 24, 0.82);
  --accent: #e8b25c;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

/* ---------- fullscreen sketch pages ---------- */
body.sketch-page { overflow: hidden; }

canvas.sketch {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;
}

/* ---------- control panel ---------- */
.panel {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 250px;
  background: var(--panel-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  z-index: 10;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0.04em;
  flex: 1;
}

.panel-back {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 16px;
  transition: color 0.2s;
}
.panel-back:hover { color: var(--ink); }

.panel-fold {
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}
.panel-fold:hover { color: var(--ink); }
.panel.folded .panel-body { display: none; }

.panel-body { padding: 12px 14px 14px; }

.panel-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.panel-row:last-child { margin-bottom: 0; }

.panel-row label {
  flex: 0 0 78px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

.panel-value {
  flex: 0 0 34px;
  font-size: 11px;
  color: var(--ink-dim);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.panel-note {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-dim);
}

.panel input[type='range'] {
  flex: 1;
  appearance: none;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  outline: none;
}
.panel input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  transition: transform 0.15s;
}
.panel input[type='range']::-webkit-slider-thumb:hover { transform: scale(1.25); }

.panel select {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}
.panel select option { background: #14141c; }

.panel input[type='checkbox'] {
  appearance: none;
  width: 34px;
  height: 19px;
  border-radius: 10px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.panel input[type='checkbox']::after {
  content: '';
  position: absolute;
  top: 2.5px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.2s;
}
.panel input[type='checkbox']:checked { background: var(--accent); }
.panel input[type='checkbox']:checked::after { transform: translateX(14px); }

.panel button {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  width: 100%;
}
.panel button:hover { background: rgba(255, 255, 255, 0.13); }
.panel button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #14100a;
  font-weight: 600;
}
.panel button.primary:hover { filter: brightness(1.1); }

.panel-buttons { display: flex; gap: 8px; }
.panel-buttons button { flex: 1; }

@media (max-width: 640px) {
  .panel { width: calc(100vw - 40px); }
}

/* ---------- gallery ---------- */
body.gallery {
  overflow-x: hidden;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(90, 60, 160, 0.18), transparent 60%),
    radial-gradient(900px 600px at 5% 110%, rgba(232, 178, 92, 0.10), transparent 55%),
    var(--bg);
  min-height: 100%;
}

.hero {
  max-width: 1060px;
  margin: 0 auto;
  padding: 96px 32px 40px;
}

.hero .eyebrow {
  font-size: 12px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.hero h1 em {
  font-style: italic;
  background: linear-gradient(100deg, #e8b25c, #e27d9e 45%, #7f9cf5 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin-top: 22px;
  max-width: 560px;
  color: var(--ink-dim);
  font-size: 15.5px;
  line-height: 1.65;
}

.grid {
  max-width: 1060px;
  margin: 24px auto 120px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  display: block;
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  background: #101018;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.35s;
}
.card:hover { transform: translateY(-5px); border-color: rgba(236, 231, 219, 0.3); }

.card canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
}

.card .meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 40px 18px 16px;
  background: linear-gradient(transparent, rgba(5, 5, 9, 0.85) 70%);
}

.card .meta h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
}

.card .meta span {
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.05em;
}

.footer {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 32px 60px;
  color: var(--ink-dim);
  font-size: 12.5px;
}
