:root {
  --carbon: #0a0908;
  --ink: #14110f;
  --velvet: #1c1916;
  --ash: #2a2520;
  --smoke: #6f685e;
  --bone: #cfc8b8;
  --ivory: #f4efe4;

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Geist", -apple-system, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;

  --tracking-mono: 0.22em;
}

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

html, body {
  background: var(--carbon);
  color: var(--ivory);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

/* ---------- site header (statisch, links terug naar henevor.com) ---------- */
.hv-nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 18px clamp(20px, 3.2vw, 48px);
  border-bottom: 1px solid var(--ash);
  background: var(--carbon);
}
.hv-nav .logo {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 24px; letter-spacing: -0.025em; line-height: 1;
  color: var(--ivory); text-decoration: none;
}
.hv-nav .links {
  display: flex; gap: clamp(20px, 2.4vw, 36px);
  font-family: var(--mono); font-size: 11px; letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
}
.hv-nav .links a {
  color: var(--smoke); text-decoration: none; padding-bottom: 4px;
  border-bottom: 1.5px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
.hv-nav .links a:hover { color: var(--ivory); border-bottom-color: var(--bone); }
.hv-nav .hv-cta {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 11px 18px; border: 1px solid var(--bone); border-radius: 999px;
  background: transparent; color: var(--ivory);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
  transition: background 200ms ease, color 200ms ease;
}
.hv-nav .hv-cta:hover { background: var(--ivory); color: var(--carbon); }
.hv-nav .hv-cta .arr { font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1; }
@media (max-width: 720px) {
  .hv-nav { flex-wrap: wrap; gap: 12px; }
  .hv-nav .links { order: 3; width: 100%; justify-content: flex-start; gap: 18px; }
}

.wrap {
  max-width: 1640px;
  margin: 0 auto;
  padding: clamp(24px, 3vw, 40px) clamp(20px, 3.2vw, 48px) 80px;
}

/* ---------- header ---------- */
.head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--ash);
  padding-bottom: 18px;
}
.wordmark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 34px;
  letter-spacing: -0.01em;
}
.kicker {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  font-size: 12px;
  color: var(--smoke);
}

/* ---------- lede ---------- */
.lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: 26px;
  line-height: 1.35;
  max-width: 720px;
  margin: 32px 0 40px;
  color: var(--ivory);
}

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

/* ---------- slots ---------- */
.slots {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: auto auto;
  gap: 14px;
}
.slot-front { grid-row: 1 / 3; }
.slot {
  position: relative;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--ash);
  background-color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 120ms ease;
}
.slot-angle { aspect-ratio: 4 / 3; }
.slot:hover { border-color: var(--bone); }
.slot.dragover { border-color: var(--ivory); }
.slot.empty {
  border-style: dashed;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0,
    transparent 11px,
    rgba(255, 255, 255, 0.015) 11px,
    rgba(255, 255, 255, 0.015) 12px
  );
}
.slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.slot-tag {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 9px;
  color: var(--bone);
  background: rgba(10, 9, 8, 0.72);
  padding: 5px 8px;
}
.slot.empty .slot-tag { color: var(--smoke); background: transparent; }
.slot-cta {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  font-size: 11px;
  color: var(--smoke);
  pointer-events: none;
}
.slot:not(.empty) .slot-cta { display: none; }
.slot-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--bone);
  background: rgba(10, 9, 8, 0.78);
  color: var(--ivory);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.slot-remove:hover { border-color: var(--ivory); }

/* ---------- controls ---------- */
.controls {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 560px;
}
.control {
  display: grid;
  grid-template-columns: 120px auto 1fr 48px;
  align-items: center;
  gap: 14px;
}
.control-label {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  font-size: 11px;
  color: var(--smoke);
}
.control:not(:has(.swatch)) input[type="range"] { grid-column: 2 / 4; }
.control-val {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--bone);
  text-align: right;
}
.swatch {
  width: 18px;
  height: 18px;
  border: 1px solid var(--ash);
  background: var(--ivory);
}

/* segmented format toggle */
.control-format { grid-template-columns: 120px 1fr; }
.seg {
  display: flex;
  gap: 0;
  border: 1px solid var(--ash);
  border-radius: 999px;
  overflow: hidden;
  width: max-content;
}
.seg-btn {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--smoke);
  background: transparent;
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--ash); }
.seg-btn.active { color: var(--carbon); background: var(--ivory); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 1px;
  background: var(--ash);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--ivory);
  border: none;
  margin-top: -1px;
}
input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--ivory);
  border: none;
}
/* grotere, makkelijk te grijpen schuifknop op touch (iPhone/iPad) */
@media (pointer: coarse) {
  input[type="range"] { height: 4px; border-radius: 999px; }
  input[type="range"]::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -11px; }
  input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; }
}

/* ---------- pill ---------- */
.pill {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  font-size: 12px;
  color: var(--ivory);
  background: transparent;
  border: 1px solid var(--ash);
  border-radius: 999px;
  padding: 13px 20px;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
  white-space: nowrap;
}
.pill:hover:not(:disabled) { border-color: var(--bone); }
.pill:disabled { color: var(--smoke); border-color: var(--ink); cursor: not-allowed; }

/* ---------- preview ---------- */
.preview-head {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  font-size: 12px;
  color: var(--smoke);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ash);
  margin-bottom: 24px;
}
.preview-hint {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  line-height: 1.4;
  color: var(--bone);
  margin-bottom: 22px;
}
.preview-hint.hidden { display: none; }
.preview-stage {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--ash);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 18px;
}
.preview-stage img,
.preview-stage canvas {
  max-width: 100%;
  display: block;
}
.preview-stage canvas {
  touch-action: none; /* let pointer-drag pan the crop instead of scrolling */
  cursor: grab;
}
.preview-stage canvas.dragging {
  cursor: grabbing;
}
.preview-stage.empty {
  aspect-ratio: 1 / 1;
}
.preview-dl { width: 100%; text-align: center; }
.status {
  display: block;
  margin-top: 14px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  font-size: 11px;
  color: var(--smoke);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .lede { font-size: 22px; margin: 24px 0 32px; }
}

@media (max-width: 600px) {
  .head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .wordmark { font-size: 28px; }
  .control {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
  }
  .control-label { flex: 1 1 100%; }
  .swatch { order: 2; }
  .control input[type="range"] { order: 2; flex: 1 1 auto; min-width: 0; }
  .control-val { order: 2; flex: 0 0 auto; }
}
