/*
 * D.Craft drafting system — reusable vocabulary for "The Drawing Book".
 * Loaded before style.css. Page composition lives in style.css; this file
 * holds only the drawing primitives.
 * Governing rule: every annotation must describe something real.
 */

@media (prefers-reduced-motion: reduce) {
  /* All drafting animations resolve immediately to their final state.
     Populated as primitives are added in later tasks. */
  .draft-anim { animation: none !important; transition: none !important; }
}

/* --- Dual-frequency grid ----------------------------------------------
   Real graph paper has two line frequencies. A single frequency reads as a
   flat tint, which is what the current single grid does. */
.sheet {
  position: relative;
  background-image:
    linear-gradient(to right, var(--grid-line-major) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line-major) 1px, transparent 1px),
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
}

/* --- Sheet-edge ruler --------------------------------------------------
   Ticks align to the 24px fine grid, so the ruler measures something real. */
.sheet::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 14px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  background: repeating-linear-gradient(
    to bottom,
    var(--hairline) 0 1px,
    transparent 1px 24px
  );
}
@media (max-width: 639px) { .sheet::after { display: none; } }

/* --- Ink in paper, not on it ------------------------------------------
   multiply makes overlapping strokes darken like real ink. Applied to every
   drawn element. This is the single highest-impact change in the uplift. */
.draft-ink,
.drawing-svg,
.service-drawing svg,
.tile-sketch svg {
  mix-blend-mode: multiply;
}

/* --- Ghosted sheet number ---------------------------------------------
   Straight from real drawing sheets: the sheet's own number, set huge and
   nearly invisible behind the content. Decorative only. */
.sheet-ghost {
  position: absolute;
  top: 2vw;
  right: 3vw;
  z-index: 0;
  pointer-events: none;
  font-family: var(--font-display);
  font-size: clamp(8rem, 22vw, 20rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink-ghost);
  user-select: none;
}
.sheet > .container { position: relative; z-index: 1; }

/* --- Registration marks ------------------------------------------------ */
.reg-marks { position: absolute; inset: 0; pointer-events: none; color: var(--frame-line); }
.reg-marks .reg-mark { position: absolute; }
.reg-marks .reg-mark:nth-child(1) { top: 14px; left: 14px; }
.reg-marks .reg-mark:nth-child(2) { top: 14px; right: 14px; }
.reg-marks .reg-mark:nth-child(3) { bottom: 14px; left: 14px; }
.reg-marks .reg-mark:nth-child(4) { bottom: 14px; right: 14px; }

/* --- Callouts ----------------------------------------------------------
   Annotated the way a real drawing is: the leader dot sits ON the feature,
   a short leader line runs away from it, and the label rides over the
   artwork on a small backing plate so it stays readable once the
   photograph fades in. Offsets are always positive, so the whole callout
   lives inside its positioned parent and the load-bearing overflow:hidden
   on .drawing-reveal can never clip it — at any viewport width. */
.callout {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--ink-900);
  pointer-events: none;
}
.callout-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold-500);
  flex: none;
  box-shadow: 0 0 0 2px var(--plate-fill);
}
.callout-line {
  height: 1px;
  width: 48px;
  flex: none;
  background: var(--hairline);
  box-shadow: 0 1px 0 var(--plate-fill), 0 -1px 0 var(--plate-fill);
}
.callout-label {
  padding: 2px var(--space-2);
  background: var(--plate-fill);
  border: 1px solid var(--hairline);
  line-height: 1.3;
  white-space: nowrap;
}

/* .callout-right's dot lands on the teak carcass; .callout-left's dot lands
   on the drawer stack — both features the label actually names. */
.callout-right { right: 5%; top: 22%; }
.callout-left { left: 9%; bottom: 40%; }

/* Below 640px the drawing itself is small enough that an on-artwork label
   would cover the feature it points at, so the annotation stands down. */
@media (max-width: 639px) { .callout { display: none; } }
