/* SORIART · Scribble portrait (About module)
   Scoped under .sxs. No remote assets. Colors from the site palette. */
.sxs {
  --sxs-ink: #fb50dc;
  --sxs-bg: #10110f;
  --sxs-fg: #f0f0e9;
  --sxs-well: #1b1c19;
  --sxs-line: rgba(240, 240, 233, 0.2);
  --sxs-line-strong: rgba(240, 240, 233, 0.5);
  --sxs-dim: rgba(240, 240, 233, 0.64);
  margin: 0;
  width: 100%;
  max-width: 500px;
  display: grid;
  gap: 12px;
  color: var(--sxs-fg);
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}
.sxs *, .sxs *::before, .sxs *::after { box-sizing: border-box; }

/* Frame keeps the photo's exact ratio: nothing is cropped. */
.sxs__frame {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1600 / 1489;
  overflow: hidden;
  background: var(--sxs-well);
}
.sxs__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;          /* same ratio as the frame, so no crop */
  filter: grayscale(1);       /* B&W on the photo only; file stays in color */
  -webkit-user-drag: none;
  user-select: none;
}
.sxs__demo,
.sxs__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;       /* outside drawing mode, touches reach the page */
}
.sxs__demo { color: var(--sxs-ink); overflow: visible; }
.sxs__canvas { touch-action: auto; }

/* Drawing mode: the portrait captures gestures, nothing else does. */
.sxs.is-drawing .sxs__frame {
  outline: 1px solid var(--sxs-ink);
  outline-offset: 3px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.sxs.is-drawing .sxs__canvas {
  pointer-events: auto;
  touch-action: none;
  cursor: crosshair;
}
.sxs__canvas:focus { outline: none; }
.sxs__canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--sxs-fg); }

/* Keyboard pen cursor */
.sxs__kcursor {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2px solid var(--sxs-ink);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(16, 17, 15, 0.55);
}
.sxs__kcursor::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: var(--sxs-ink);
}
.sxs__kcursor.is-down { background: rgba(251, 80, 220, 0.35); }

/* Image fallback */
.sxs__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  font-size: 16px;
  color: var(--sxs-fg);
  border: 1px solid var(--sxs-line);
}
.sxs__fallback span { font-size: 12.5px; color: var(--sxs-dim); }

/* Controls */
.sxs__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.sxs__group { display: flex; flex-wrap: wrap; gap: 8px; }
.sxs__group + .sxs__group { margin-left: auto; }
.sxs__btn {
  appearance: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--sxs-line);
  border-radius: 4px;
  background: transparent;
  color: var(--sxs-fg);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sxs__btn:hover { border-color: var(--sxs-line-strong); }
.sxs__btn:focus-visible { outline: 2px solid var(--sxs-ink); outline-offset: 2px; }
.sxs__btn[aria-pressed="true"] { border-color: var(--sxs-ink); color: var(--sxs-ink); }
.sxs__btn--primary {
  background: var(--sxs-ink);
  border-color: var(--sxs-ink);
  color: var(--sxs-bg);
  font-weight: 600;
}
.sxs__btn--primary:hover { border-color: var(--sxs-fg); }
.sxs__btn--icon { padding: 0; width: 44px; }
.sxs__btn svg { width: 16px; height: 16px; display: block; }
.sxs__dot {
  display: block;
  border-radius: 50%;
  background: currentColor;
}
.sxs__help {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--sxs-dim);
  max-width: 60ch;
}
.sxs__sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.sxs [hidden] { display: none !important; }

@media (max-width: 420px) {
  .sxs__group + .sxs__group { margin-left: 0; }
}
/* The existing 1:2 About columns are too narrow for drawing tools on tablets. */
@media (min-width: 761px) and (max-width: 980px) {
  .about-intro:has(> .sxs) { grid-template-columns: 1fr; gap: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .sxs * { transition: none !important; animation: none !important; }
}
