/* ============================================
   Drawing easter egg — pencil, colors, eraser
   ============================================ */

.draw-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}

/* Pencil cursor (24x24) — only when over drawable area */
body.draw-mode {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z'/%3E%3C/svg%3E") 4 20, crosshair;
}

body.draw-mode a,
body.draw-mode button,
body.draw-mode input,
body.draw-mode select,
body.draw-mode textarea,
body.draw-mode [role="button"],
body.draw-mode [tabindex],
body.draw-mode .section-link,
body.draw-mode .hero-name,
body.draw-mode .t-avatar,
body.draw-mode .hero-brand-pill,
body.draw-mode .philosophy-card-v2,
body.draw-mode .project-card,
body.draw-mode .draw-toolbar,
body.draw-mode .draw-toolbar *,
body.draw-mode .project-modal-close {
  cursor: pointer;
}

body.draw-mode.eraser-mode {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235c5c5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 21h10'/%3E%3Cpath d='M5 11l4-4 8 8-4 4-4-4'/%3E%3Cpath d='M19 15l-4-4'/%3E%3C/svg%3E") 12 12, cell;
}

/* Toolbar — bottom right */
.draw-toolbar {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--color-border, #e8e8e8);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  font-family: var(--font-body, -apple-system, sans-serif);
}

.draw-toolbar::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 13px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0,0,0,0.03), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.draw-toolbar .draw-divider {
  width: 1px;
  height: 1.5rem;
  background: var(--color-border, #e8e8e8);
  margin: 0 0.25rem;
}

.draw-toolbar button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.draw-toolbar button:hover {
  background: rgba(0, 0, 0, 0.06);
}

.draw-toolbar button:active {
  transform: scale(0.95);
}

.draw-toolbar button.active {
  background: rgba(0, 82, 204, 0.12);
  color: var(--color-accent, #0052cc);
}

.draw-toolbar .draw-colors {
  display: flex;
  gap: 0.25rem;
}

.draw-toolbar .draw-color-swatch {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
}

.draw-toolbar .draw-color-swatch:hover {
  transform: scale(1.1);
}

.draw-toolbar .draw-color-swatch.active {
  border-color: #1a1a1a;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.8);
}

.draw-toolbar .draw-color-wheel-btn {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 2px solid var(--color-border, #e8e8e8);
  background: linear-gradient(135deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s;
}

.draw-toolbar .draw-color-wheel-btn:hover {
  transform: scale(1.08);
}

.draw-toolbar .draw-color-picker-wrap {
  position: relative;
}

.draw-toolbar .draw-color-popover {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  right: 0;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid var(--color-border, #e8e8e8);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  display: none;
}

.draw-toolbar .draw-color-popover.open {
  display: block;
}

.draw-toolbar .draw-color-popover input[type="color"] {
  width: 8rem;
  height: 2.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  background: transparent;
}

.draw-toolbar .draw-eraser-btn svg,
.draw-toolbar .draw-clear-btn svg,
.draw-toolbar .draw-toggle-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* Draw mode toggle — mobile only */
@media (min-width: 641px) {
  .draw-toggle-btn,
  .draw-toggle-divider {
    display: none;
  }
}

@media (max-width: 640px) {
  body.draw-enabled .draw-toolbar {
    border-color: rgba(0, 82, 204, 0.35);
    box-shadow: 0 4px 24px rgba(0, 82, 204, 0.12);
  }

  .draw-toolbar {
    bottom: 1rem;
    right: 1rem;
    padding: 0.4rem 0.6rem;
    gap: 0.35rem;
  }
}

.draw-mobile-hint {
  position: fixed;
  bottom: calc(1rem + 3.25rem);
  right: 1rem;
  z-index: 10002;
  max-width: 11rem;
  padding: 0.5rem 0.75rem;
  background: #1a1a1a;
  color: #fff;
  font-family: var(--font-body, -apple-system, sans-serif);
  font-size: 0.8125rem;
  line-height: 1.35;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.draw-mobile-hint.visible {
  opacity: 1;
  transform: translateY(0);
}

.draw-mobile-hint::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 1.25rem;
  width: 10px;
  height: 10px;
  background: #1a1a1a;
  transform: rotate(45deg);
}
