/* ══════════════════════════════════════════════════════════════════════════
   THE PROFILE SURFACE  ·  the classic drawing + its readback, authored once
   (founder lift 2026-07-15): consumed by BOTH pages of the manual pair —
   index.html (set-up, drawing dormant behind the display switch) and
   manual.html (the profile-view tab of the Simulation group). Rail styling is
   the set-up page's own; house zones come from house.css part A; palette tokens
   from house.css B·§12 (etched's latent tokens live here — the drawing's own
   retired vein, not a house vein).

   Sections: 1 DIAGRAM · 2 READBACK (RETIRED → the house verdict strip, S3) · 3 PER-VEIN DRAWING EXTENSIONS ·
             4 TITLE-BLOCK STAMP · 5 MOTION
   ══════════════════════════════════════════════════════════════════════════ */

/* ═══ 1 · THE DIAGRAM ═══════════════════════════════════════════════════════ */
.profile-canvas { position: relative; overflow: hidden; }
.profile-canvas svg#view { width: 100%; height: 100%; display: block; }

/* ═══ 2 · THE READBACK — RETIRED (S3). The manual pair's status IS the standard
   verdict strip now: house.css A·§6 (.readback ground) + B·§4 (#verdict metrics) +
   B·§5 (#solvestate fold). The hand-rolled #footer column — its .metrics/.stat/.shape
   and the #export placement — is gone. The seed's predicted-shape (.shape) retired
   with shapeConfidence; the export action lives on the sheet (stage 05). One source,
   every console. ════════════════════════════════════════════════════════════════ */

/* ═══ 3 · PER-VEIN DRAWING EXTENSIONS ═══ the drawing field only — rail skins
   stay on the set-up page ═══════════════════════════════════════════════════ */
/* BLUEPRINT — the drawing field: fine+coarse graph grid (frame convicted, gone) */
body[data-chrome="blueprint"] .profile-canvas {
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 26px 26px, 26px 26px, 130px 130px, 130px 130px;
}
/* the drawn canvas frames LEFT with the separator ruling (fifth catch
   2026-07-22 — same convicted class as the sheet outlines; the grid and the
   vellum ARE the ground, no frame). */
body[data-chrome="blueprint"] path.glassseg { filter: drop-shadow(0 0 2px rgba(255,255,255,0.45)); }

/* DRAFTING — ink on vellum */
body[data-chrome="drafting"] .profile-canvas {
  background-image:
    linear-gradient(rgba(0,0,0,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.035) 1px, transparent 1px);
  background-size: 26px 26px;
}

/* ETCHED — the drawing's own latent vein (retired from the cycler, kept as
   capability): geometry engraved into a dark glass plate, edge-lit. The token
   block lives here because only the profile surface carries this vein. */
body[data-chrome="etched"] {
  --bg: #0a1418; --panel: #0c181d; --line: #244249; --line-soft: #152a2f;
  --ink: #dceff2; --dim: #8fb3ba; --faint: #5e8188;
  --blue: #ecfbff; --glass-ext: #a6d2db;
  --chrome: #4e7d86; --wire: #cfe9ee; --hinge-ref: #4e7d86; --witness: #4e7d86;
  --motor: #dceff2; --label-value: #ecfbff; --label-name: #8fb3ba;
  --lockup-ink: var(--ink); /* class:family(lockup) — the family follows the MARK: this dark vein serves the reversed artwork, the text rides the vein ink (fifth catch 2026-07-22) */
  --object-line: #4e7d86; --glass-ext-line: #a6d2db; /* W2 split aliases — this vein's own --chrome/--glass-ext (render-preserving; the completeness law) */
  --ok: #7fe0c0; --warn: #ffd58a; --bad: #ff9a8f;
  color: var(--ink);
  background:
    radial-gradient(150% 65% at 50% -20%, rgba(120,205,215,0.16) 0%, rgba(10,20,24,0) 55%),
    linear-gradient(180deg, #0d1c21 0%, #070f12 100%);
}
body[data-chrome="etched"] .profile-canvas { background: linear-gradient(158deg, rgba(255,255,255,0.035) 0%, rgba(255,255,255,0) 42%); }
body[data-chrome="etched"] #view path,
body[data-chrome="etched"] #view line { filter: drop-shadow(0 0 1.4px rgba(180,232,242,0.45)); }
body[data-chrome="etched"] path.glassseg { filter: drop-shadow(0 0 3px rgba(190,245,255,0.82)) drop-shadow(0 0 10px rgba(150,220,235,0.34)); }

/* ═══ 4 · TITLE-BLOCK STAMP ═══ the drawing's stamp, drawing modes only ═════ */
#titleblock { display: none; }
body[data-chrome="blueprint"] #titleblock,
body[data-chrome="drafting"] #titleblock,
body[data-chrome="etched"] #titleblock {
  display: grid; position: absolute; right: 26px; bottom: 26px; z-index: 3;
  grid-template-columns: auto auto; font-size: var(--fs-micro); line-height: 1.5;
  border: 1px solid currentColor; color: var(--dim); background: var(--panel);
}
#titleblock b { color: var(--ink); font-weight: 600; letter-spacing: 0.1em; }
#titleblock .tb-title { grid-column: 1 / -1; padding: 5px 10px; border-bottom: 1px solid currentColor; letter-spacing: 0.16em; } /* chrome-scan: justified — title-block stamp anatomy, a drawn object */
#titleblock .tb-cell { padding: 4px 10px; }
#titleblock .tb-cell + .tb-cell { border-left: 1px solid currentColor; }
/* per-vein type — the drawing reads in a technical mono in the drawing looks */
body[data-chrome="blueprint"] #view text, body[data-chrome="drafting"] #view text, body[data-chrome="etched"] #view text,
body[data-chrome="blueprint"] #titleblock, body[data-chrome="drafting"] #titleblock, body[data-chrome="etched"] #titleblock {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ═══ 5 · MOTION ═══ calm settle on reveal (opacity only) ═══════════════════ */
@keyframes chrome-settle { from { opacity: 0; } to { opacity: 1; } }
#view.chrome-anim > g { animation: chrome-settle 0.4s ease-out both; }
@media (prefers-reduced-motion: reduce) { #view.chrome-anim > g { animation: none; } }
/* the dark-lockup family law on ETCHED (2026-07-22) — same mechanism as the
   house's factory/blueprint rules: the approved reversed mark shows, the
   colour mark hides, the single-mark neutral glyph keeps the lossless invert.
   (Etched previously had NO dark-mark treatment at all — the gap closed with
   the family law.) */
body[data-chrome="etched"] .mh-mark--dark { display: block; }
body[data-chrome="etched"] .mh-mark--light { display: none; }
body[data-chrome="etched"] .mh-mark:not(.mh-mark--light):not(.mh-mark--dark) { filter: invert(1); }

/* ═══ 6 · THE PIPELINE STATE WASH (WO-W4-DISPLAY) ═══ the drawing is the field
   engine's; while a newer edit solves, the last drawing stands WASHED — a
   declared in-flight state, never a blank pane and never an undeclared stale
   truth (the SES-029 stale-verdict class, extended to the drawing). */
.profile-canvas.solving #view { opacity: 0.45; transition: opacity 0.2s ease-out; }
#pipeband:empty { display: none; }
