/* ─── Lithophane maker — page-specific styles ──────────────────────────
   Loaded only on /lithophane. Uses the shared design tokens from styles.css
   so it themes automatically with the rest of the site. */

.litho-hero { padding: 90px 0 24px; }
.litho-hero .section-intro { margin-bottom: 0; max-width: 640px; }

.litho-maker { padding: 36px 0 100px; }

/* ─── Upload drop zone ─── */
.litho-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius-card, 18px);
  background: var(--surface);
  padding: 64px 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.litho-drop:hover,
.litho-drop:focus-visible { border-color: var(--accent); outline: none; }
.litho-drop.is-dragover {
  border-color: var(--accent);
  background: var(--bg-elevated);
  transform: scale(1.005);
}
.litho-drop__inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.litho-drop__icon { width: 52px; height: 52px; color: var(--accent); margin-bottom: 6px; }
.litho-drop h3 {
  font-size: 22px;
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 600;
}
.litho-drop p { color: var(--text-soft); font-size: 15px; }
.litho-drop__hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 8px;
}
.litho-link {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

/* ─── Stage: preview + controls ─── */
.litho-stage {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 32px;
  align-items: start;
}
/* The [hidden] attribute alone loses to the display rule above. */
.litho-stage[hidden] { display: none; }

/* 3D preview */
.litho-preview {
  position: sticky;
  top: 88px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card, 18px);
  padding: 14px;
}
.litho-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-input, 12px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(var(--halo-radial-1), 0.12), transparent 70%),
    var(--bg-elevated);
  touch-action: none;
  cursor: grab;
}
.litho-canvas:active { cursor: grabbing; }
.litho-canvas canvas { display: block; width: 100%; height: 100%; }
/* Backlit mode: darken the surround so the lithophane glow reads clearly. */
.litho-canvas.is-backlit {
  background: radial-gradient(circle at 50% 42%, #2a2a2a, #050505 78%);
  transition: background 0.3s ease;
}
.litho-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-mute);
  pointer-events: none;
}

.litho-preview__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 6px 4px;
}
.litho-preview__hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-mute);
}
.litho-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn, 999px);
  padding: 7px 14px;
  font: 500 13px 'DM Sans', sans-serif;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.litho-toggle__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-mute);
  transition: background 0.2s, box-shadow 0.2s;
}
.litho-toggle[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--accent);
}
.litho-toggle[aria-pressed="true"] .litho-toggle__dot {
  background: var(--accent);
  box-shadow: 0 0 10px 1px var(--accent);
}

/* Controls panel */
.litho-controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card, 18px);
  padding: 24px;
}
.litho-control { margin-bottom: 22px; }
.litho-control > label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
}
.litho-control > label small,
.litho-drop__inner small { color: var(--text-mute); font-weight: 400; }

/* Segmented control */
.litho-segmented {
  display: flex;
  gap: 8px;
}
.litho-segmented button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input, 12px);
  color: var(--text-soft);
  font: 500 14px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.litho-segmented button small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-mute);
}
.litho-segmented button:hover { border-color: var(--accent-deep); }
.litho-segmented button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--surface);
  color: var(--text);
}
.litho-segmented button[aria-pressed="true"] small { color: var(--accent); }

.litho-note {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-soft);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-input, 12px);
  padding: 12px 14px;
  margin-bottom: 22px;
}

/* Order form */
.litho-order { position: relative; }
.litho-order .form-field { margin-bottom: 14px; }
.litho-order .form-field label small { color: var(--text-mute); }
.litho-order__fineprint {
  font-size: 12.5px;
  color: var(--text-mute);
  text-align: center;
  margin-top: 12px;
}
.litho-success { margin-top: 8px; }
.litho-success.show { display: block; }

/* ─── Responsive ─── */
@media (max-width: 860px) {
  .litho-stage { grid-template-columns: 1fr; }
  .litho-preview { position: static; }
}
@media (max-width: 600px) {
  .litho-drop { padding: 44px 18px; }
  .litho-controls { padding: 18px; }
}
