/* =============================================================
   TraceRecord — Trace Fields (Concept 4) · tr-fields.css

   Semantic background motifs. Twelve fields, one sprite, applied
   declaratively with data-tr-field. Every trace means something;
   most of the page stays quiet; different job relationships get
   different fields; never decorate where structure is enough.

   Compositions bleed past an edge. Nothing is centred, and no
   element is complete — a field is a fragment of a relationship,
   not an illustration of one.
   ============================================================= */

.tr-field-host { position: relative; }
.tr-field-host, .tr-field-host--positioned { isolation: isolate; }

.tr-field {
  position: absolute;
  pointer-events: none;
  user-select: none;
  color: #17242c;
  z-index: 0;
  width: min(42vw, 520px);
  height: auto;
  aspect-ratio: 3 / 2;
}

/* ---- intensity: only the opacity changes ---- */
.tr-field--ghost         { opacity: .035; }
.tr-field--structural    { opacity: .07; }
.tr-field--demonstrative { opacity: .13; }
/* navy grounds need more ink to read at all */
.tr-field--on-dark                          { color: #f6f3ea; }
.tr-field--on-dark.tr-field--ghost          { opacity: .085; }
.tr-field--on-dark.tr-field--structural     { opacity: .13; }
.tr-field--on-dark.tr-field--demonstrative  { opacity: .18; }

/* ---- placement: margins and edges, never behind prose ---- */
.tr-field--top-right     { top: -5%;    right: -6%; }
.tr-field--top-left      { top: -5%;    left: -6%; }
.tr-field--right         { top: 50%;    right: -7%; transform: translateY(-50%); }
.tr-field--bottom-right  { bottom: -7%; right: -5%; }
.tr-field--bottom-left   { bottom: -7%; left: -5%; }
.tr-field--left-margin   { top: 8%;     left: -9%;  width: min(30vw, 360px); }
.tr-field--baseline      { bottom: -4%; left: 4%;   width: min(64vw, 780px); aspect-ratio: 3 / 1; }

/* full-bleed ledger: the one motif permitted to repeat, because a repeating
   baseline is itself the meaning. Painted, so the rhythm holds at any height. */
.tr-field--bleed,
.tr-field--ledger-bleed {
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}
.tr-field--ledger-bleed {
  background-image: repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 72px);
}
@media (max-width: 860px) {
  /* remove geometry, keep the relationship: a wider, calmer rhythm */
  .tr-field--ledger-bleed { background-image: repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 104px); }
}

/* ---- responsive: remove geometry, keep the relationship ---- */
.tr-field--sm { display: none; }
@media (max-width: 860px) {
  .tr-field--lg { display: none; }
  .tr-field--sm { display: block; width: min(56vw, 290px); }
  .tr-field--sm.tr-field--bleed { width: 100%; }
  .tr-field--drop-sm { display: none; }
  .tr-field--top-right    { top: -3%; right: -13%; }
  .tr-field--right        { right: -15%; }
  .tr-field--bottom-right { bottom: -3%; right: -13%; }
  .tr-field--baseline     { width: 92%; left: 4%; }
  .tr-field--left-margin  { left: -16%; width: min(46vw, 250px); }
}

/* Content sits above the field plane */
.tr-field-host > :not(.tr-field) { position: relative; z-index: 1; }

/* Surfaces that must stay clean: the report is a document, not a mood.
   The active record surface in the Workspace carries nothing either. */
.tr-report, .tr-report *, .report-page,
.wsv4-record, .wsv4-canvas, .tool-desk-panel { --tr-field-allowed: 0; }
.tr-report .tr-field, .report-page .tr-field,
.wsv4-record .tr-field, .wsv4-canvas .tr-field, .tool-desk-panel .tr-field { display: none; }

/* Anchor alias helper (invisible in-page jump target) */
.tr-anchor-alias { position: relative; top: -72px; display: block; height: 0; }

@media print { .tr-field { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .tr-field { transition: none; } }

/* Field marks are decorative and sit to the right of their host, so at narrow
   widths they can extend past the viewport edge. They are ornament, never
   content: the document clips them instead of gaining a horizontal scrollbar.
   `clip` rather than `hidden` so position: sticky keeps working. */
html, body { overflow-x: clip; }
@supports not (overflow: clip) { html, body { overflow-x: hidden; } }
