/* /transparency/check/ only: the seal picture, its steps, the example QR codes
   and the camera scanner. Shared checker styles (.seal-result and friends) stay
   in styles.css. The picture's markup is src/seal-picture.mjs; it carries no
   inline styles, so every colour, size and movement is here. */

.seal-how__intro { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 0.5rem 2rem; margin-bottom: clamp(1.25rem, 3vw, 2rem); }
.seal-how__intro h2 { margin: 0; }
.seal-how__intro .text-link:hover > span { transform: translateY(2px); }

/* ---- The picture ---------------------------------------------------- */
.seal-picture {
  --sp-paper: var(--paper-bright);
  --sp-ink: var(--ink);
  --sp-soft: var(--ink-soft);
  --sp-quiet: var(--muted);
  --sp-line: var(--line-strong);
  --sp-accent: var(--accent);
  --sp-brass: #9a7a2e;
  --sp-rust: #9b2c2c;
  --sp-case: #fff;
  margin: 0;
}
.seal-picture__stage { padding: clamp(0.65rem, 2.6vw, 2.25rem); border: 1px solid var(--line); border-radius: 0.75rem; background: var(--sp-paper); }
.seal-picture__svg { display: block; width: 100%; height: auto; margin-inline: auto; overflow: visible; }
.seal-picture__svg--wide { display: none; }
.seal-picture__svg--tall { max-width: 26rem; }
@media (min-width: 62rem) {
  .seal-picture__svg--wide { display: block; }
  .seal-picture__svg--tall { display: none; }
}

.seal-picture__svg text { font-family: var(--font-display); fill: var(--sp-ink); }
.sp-line, .sp-trace, .sp-stray-line, .sp-own, .sp-hit, .sp-ring { fill: none; }
.sp-line { stroke: var(--sp-line); stroke-width: 1; }
.sp-label { font-size: 21px; dominant-baseline: central; }
.sp-label--halo { paint-order: stroke; stroke: var(--sp-paper); stroke-width: 6px; stroke-linejoin: round; }
.sp-label--end { text-anchor: end; }
.sp-boxlabel { font-size: 17px; text-anchor: middle; fill: var(--sp-soft); }
.sp-frame { fill: color-mix(in srgb, var(--sp-ink) 4%, var(--sp-paper)); stroke: var(--sp-line); stroke-width: 1; }

/* A graded slab, small: clear case, label strip, the card behind its window. */
.sp-slab__case { fill: var(--sp-case); stroke: var(--sp-line); stroke-width: 0.9; }
.sp-slab__label { fill: color-mix(in srgb, var(--sp-ink) 9%, var(--sp-case)); }
.sp-slab__rule { fill: none; stroke: var(--sp-accent); stroke-width: 1; }
.sp-slab__card { stroke: color-mix(in srgb, var(--sp-ink) 30%, transparent); stroke-width: 0.6; }
.sp-tint-0 .sp-slab__card { fill: #9bd4c3; }
.sp-tint-1 .sp-slab__card { fill: #d9c7a0; }
.sp-tint-2 .sp-slab__card { fill: #c9b8ea; }
.sp-tint-3 .sp-slab__card { fill: #a9bfd3; }
.sp-tint-4 .sp-slab__card { fill: #efdc93; }
.sp-salt { fill: var(--sp-brass); }

/* Short codes. */
.sp-chip__box { fill: var(--sp-paper); stroke: var(--sp-line); stroke-width: 1; }
.seal-picture__svg .sp-chip__text, .seal-picture__svg .sp-plaque__hex { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-anchor: middle; dominant-baseline: central; }
.sp-chip__text { font-size: 12.5px; fill: var(--sp-soft); }
/* Stepping back: drawings fade, words only take a quieter ink (still 4.5:1). */
.sp-dim { opacity: 0.5; }
.seal-picture__svg .sp-quiet, .seal-picture__svg .sp-quiet text { fill: var(--sp-quiet); }
.sp-ring { stroke: var(--sp-brass); stroke-width: 1.6; }
.sp-own, .sp-hit { stroke: var(--sp-accent); stroke-width: 2; }
.sp-trace { stroke: var(--sp-accent); stroke-width: 2.5; stroke-linejoin: round; }

/* The fingerprint. */
.sp-plaque__box { fill: var(--sp-case); stroke: var(--sp-ink); stroke-width: 1.2; }
.sp-plaque__rule { fill: none; stroke: var(--sp-line); stroke-width: 0.7; }
.sp-plaque__title { font-size: 19px; text-anchor: middle; }
.seal-picture__svg .sp-plaque__hex { font-size: 17px; letter-spacing: 0.02em; }
.sp-stamp { transform-box: fill-box; transform-origin: center; transform: rotate(-2deg); }
.sp-stamp__box { fill: none; stroke: var(--sp-accent); stroke-width: 1.2; }
.seal-picture__svg .sp-stamp__text { font-family: var(--font-body); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-anchor: middle; dominant-baseline: central; fill: var(--sp-accent); }
.sp-match__dot { fill: var(--sp-accent); }
.sp-match__tick { fill: none; stroke: var(--sp-case); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.seal-picture__svg .sp-match__text { font-size: 17px; font-style: italic; dominant-baseline: central; fill: var(--sp-accent); }

/* One card swapped: dashed, so it does not rely on colour alone. */
.sp-stray-line { stroke: var(--sp-rust); stroke-width: 1.5; stroke-dasharray: 4 3; }
.sp-chip--stray .sp-chip__box { stroke: var(--sp-rust); stroke-dasharray: 3 2; }
.sp-chip--stray .sp-chip__text { fill: var(--sp-rust); }
.sp-chip--landing .sp-chip__box { stroke-width: 1.4; }
.sp-chip--landing .sp-chip__text { font-size: 13px; }
.sp-slab--ghost { transform-box: fill-box; transform-origin: center; transform: rotate(-7deg); }
.sp-slab--ghost .sp-slab__case { stroke: var(--sp-rust); stroke-width: 1.5; stroke-dasharray: 3 2; }
.seal-picture__svg .sp-note { font-size: 16px; font-style: italic; text-anchor: middle; fill: var(--sp-rust); }
.seal-picture__svg .sp-note--start { text-anchor: start; }
.seal-picture__svg .sp-unequal { font-size: 30px; text-anchor: middle; dominant-baseline: central; fill: var(--sp-rust); }

/* Phone variant: the same parts at phone sizes. */
.seal-picture__svg--tall .sp-label { font-size: 16px; dominant-baseline: auto; }
.seal-picture__svg--tall .sp-boxlabel { font-size: 13px; }
.seal-picture__svg--tall .sp-chip__text { font-size: 10px; }
.seal-picture__svg--tall .sp-plaque__title { font-size: 17px; }
.seal-picture__svg--tall .sp-plaque__hex { font-size: 14.5px; }
.seal-picture__svg--tall .sp-stamp__text { font-size: 9.5px; letter-spacing: 0.08em; }
.seal-picture__svg--tall .sp-match__text { font-size: 14px; }
.seal-picture__svg--tall .sp-chip--landing .sp-chip__text { font-size: 10.5px; }
.seal-picture__svg--tall .sp-note { font-size: 14.5px; }
.seal-picture__svg--tall .sp-trace { stroke-width: 2.2; }

/* Under the picture: what the diamond is, and the controls. */
.seal-picture__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; min-height: 44px; margin-top: 0.75rem; }
.seal-picture__bar { align-items: start; }
.seal-picture__legend { display: flex; flex: 1 1 18rem; flex-wrap: wrap; gap: 0.35rem 1.5rem; margin: 0; padding: 0.4rem 0 0; list-style: none; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.seal-picture__legend li { display: flex; align-items: center; gap: 0.5rem; }
.seal-picture__key { flex: 0 0 auto; width: 1.5rem; height: 0.75rem; overflow: visible; }
.seal-picture__key--salt { fill: var(--sp-brass); }
.seal-picture__key--ring { fill: none; stroke: var(--sp-brass); stroke-width: 1.6; }
.seal-picture__key--stray { fill: none; stroke: var(--sp-rust); stroke-width: 1.5; stroke-dasharray: 4 3; }
.seal-picture__legend-note { flex-basis: 100%; }
.seal-picture__controls { display: flex; gap: 0.5rem; margin-left: auto; }
.seal-picture__controls[hidden] { display: none; }
.seal-picture.is-held .seal-picture__controls { visibility: hidden; }
.seal-picture__controls button { min-width: 5.25rem; min-height: 44px; padding: 0.5rem 1rem; border: 1px solid #829d91; border-radius: var(--radius); background: transparent; color: var(--teal-ink); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.seal-picture__controls button:hover { background: var(--surface-teal); border-color: var(--accent); }

/* The four steps, as a list. */
.seal-picture figcaption { margin-top: clamp(1.5rem, 3vw, 2.25rem); }
.seal-picture .seal-steps { gap: 1.25rem 2rem; grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); }
.seal-steps li { padding-top: 0.85rem; border-top: 1px solid var(--line); }
.seal-steps .mono-label { margin: 0; }
.seal-steps h3 { margin: 0.25rem 0 0.4rem; font-size: 1.3rem; }
.seal-steps li > p:last-child { margin: 0; color: var(--ink-soft); font-size: 0.94rem; line-height: 1.6; }

/* ---- Motion --------------------------------------------------------- */
/* Each part carries a phase (when its beat starts) and an order within it. */
.sp-ph-frame { --sp-at: 0s; --sp-step: 0.05s; --sp-i: 0; }
.sp-ph-slab { --sp-at: 0.2s; --sp-step: 0.04s; --sp-i: 0; }
.sp-ph-link { --sp-at: 1.35s; --sp-step: 0.07s; --sp-i: 0; }
.sp-ph-salt { --sp-at: 1.45s; --sp-step: 0.07s; --sp-i: 0; }
.sp-ph-leaf { --sp-at: 1.7s; --sp-step: 0.07s; --sp-i: 0; }
.sp-ph-fold { --sp-at: 2.45s; --sp-step: 0.6s; --sp-i: 0; }
.sp-ph-node { --sp-at: 2.85s; --sp-step: 0.6s; --sp-i: 0; }
.sp-ph-plaque { --sp-at: 4s; --sp-step: 0s; --sp-i: 0; }
.sp-ph-hex { --sp-at: 4.35s; --sp-step: 0s; --sp-i: 0; }
.sp-ph-stamp { --sp-at: 4.9s; --sp-step: 0s; --sp-i: 0; }
.sp-ph-dim, .sp-ph-own { --sp-at: 5.7s; --sp-step: 0s; --sp-i: 0; }
.sp-ph-ring { --sp-at: 6s; --sp-step: 0.18s; --sp-i: 0; }
.sp-ph-trace { --sp-at: 6.8s; --sp-step: 0.42s; --sp-i: 0; }
.sp-ph-hit { --sp-at: 7.1s; --sp-step: 0.42s; --sp-i: 0; }
.sp-ph-match { --sp-at: 8.5s; --sp-step: 0s; --sp-i: 0; }
.sp-ph-swap { --sp-at: 9.2s; --sp-step: 0s; --sp-i: 0; }
.sp-ph-stray { --sp-at: 9.7s; --sp-step: 0.2s; --sp-i: 0; }
.sp-ph-miss { --sp-at: 11.3s; --sp-step: 0s; --sp-i: 0; }
.sp-i-1 { --sp-i: 1; } .sp-i-2 { --sp-i: 2; } .sp-i-3 { --sp-i: 3; } .sp-i-4 { --sp-i: 4; }
.sp-i-5 { --sp-i: 5; } .sp-i-6 { --sp-i: 6; } .sp-i-7 { --sp-i: 7; } .sp-i-8 { --sp-i: 8; }
.sp-i-9 { --sp-i: 9; } .sp-i-10 { --sp-i: 10; } .sp-i-11 { --sp-i: 11; } .sp-i-12 { --sp-i: 12; }
.sp-i-13 { --sp-i: 13; } .sp-i-14 { --sp-i: 14; } .sp-i-15 { --sp-i: 15; } .sp-i-16 { --sp-i: 16; }
.sp-i-17 { --sp-i: 17; } .sp-i-18 { --sp-i: 18; } .sp-i-19 { --sp-i: 19; }
.sp-pop { transform-box: fill-box; transform-origin: center; }

@keyframes sp-clock { from { opacity: 1; } to { opacity: 1; } }
@keyframes sp-fade { from { opacity: 0; } }
@keyframes sp-drop { from { opacity: 0; transform: translateY(-10px); } }
@keyframes sp-rise { from { opacity: 0; transform: translateY(-8px); } }
@keyframes sp-pop { from { opacity: 0; transform: scale(0.55); } }
@keyframes sp-draw { 0% { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; } 8% { opacity: 1; } 100% { stroke-dasharray: 1; stroke-dashoffset: 0; } }
@keyframes sp-dim { from { opacity: 1; } }
@keyframes sp-quiet { from { fill: var(--sp-soft); } }
@keyframes sp-press { from { opacity: 0; transform: rotate(-10deg) scale(1.6); } }
@keyframes sp-swap { from { opacity: 0; transform: translate(-16px, -18px) rotate(-20deg); } }
@keyframes sp-step { 6%, 94% { border-top-color: var(--accent); } }
@keyframes sp-step-number { 6%, 94% { color: var(--accent); } }

@media (prefers-reduced-motion: no-preference) {
  .seal-picture.is-playing .seal-picture__stage { animation: sp-clock 12s linear both; }
  .seal-picture.is-playing :is(.sp-fade, .sp-drop, .sp-rise, .sp-pop, .sp-draw, .sp-dim, .sp-quiet, .sp-press, .sp-swap) {
    animation-duration: 0.45s;
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
    animation-delay: calc(var(--sp-at) + var(--sp-i) * var(--sp-step));
    animation-fill-mode: both;
  }
  .seal-picture.is-playing .sp-fade { animation-name: sp-fade; }
  .seal-picture.is-playing .sp-drop { animation-name: sp-drop; }
  .seal-picture.is-playing .sp-rise { animation-name: sp-rise; animation-duration: 0.55s; }
  .seal-picture.is-playing .sp-pop { animation-name: sp-pop; animation-duration: 0.4s; }
  .seal-picture.is-playing .sp-draw { animation-name: sp-draw; animation-duration: 0.5s; animation-timing-function: cubic-bezier(0.45, 0, 0.3, 1); }
  .seal-picture.is-playing .sp-dim { animation-name: sp-dim; animation-duration: 0.6s; }
  .seal-picture.is-playing .sp-quiet, .seal-picture.is-playing .sp-quiet text { animation-name: sp-quiet; animation-duration: 0.6s; }
  .seal-picture.is-playing .sp-press { animation-name: sp-press; animation-duration: 0.35s; animation-timing-function: cubic-bezier(0.3, 1.3, 0.5, 1); }
  .seal-picture.is-playing .sp-swap { animation-name: sp-swap; animation-duration: 0.55s; }
  /* The list follows the picture: each step is marked while its part plays. */
  .seal-picture.is-playing .seal-steps li { animation: sp-step linear both; }
  .seal-picture.is-playing .seal-steps .mono-label { animation: sp-step-number linear both; }
  .seal-picture.is-playing .seal-steps li:nth-child(1), .seal-picture.is-playing .seal-steps li:nth-child(1) .mono-label { animation-duration: 4s; animation-delay: 0s; }
  .seal-picture.is-playing .seal-steps li:nth-child(2), .seal-picture.is-playing .seal-steps li:nth-child(2) .mono-label { animation-duration: 1.6s; animation-delay: 4s; }
  .seal-picture.is-playing .seal-steps li:nth-child(3), .seal-picture.is-playing .seal-steps li:nth-child(3) .mono-label { animation-duration: 1.1s; animation-delay: 5.6s; }
  .seal-picture.is-playing .seal-steps li:nth-child(4), .seal-picture.is-playing .seal-steps li:nth-child(4) .mono-label { animation-duration: 5.3s; animation-delay: 6.7s; }
  .seal-picture.is-paused .seal-picture__stage, .seal-picture.is-paused .seal-picture__stage *, .seal-picture.is-paused .seal-steps li, .seal-picture.is-paused .seal-steps .mono-label { animation-play-state: paused; }
}
@media print {
  .seal-picture .seal-picture__stage, .seal-picture .seal-picture__stage *, .seal-picture .seal-steps li, .seal-picture .seal-steps .mono-label { animation: none !important; }
  .seal-picture__controls { display: none; }
}
@media (forced-colors: active) {
  .seal-picture { --sp-paper: Canvas; --sp-case: Canvas; --sp-ink: CanvasText; --sp-soft: CanvasText; --sp-quiet: GrayText; --sp-line: CanvasText; --sp-accent: Highlight; --sp-brass: CanvasText; --sp-rust: LinkText; }
  .seal-picture__svg { forced-color-adjust: none; }
  .seal-picture__stage { border-color: CanvasText; }
  .seal-picture__svg :is(.sp-frame, .sp-slab__label) { fill: Canvas; }
  .seal-picture__svg .sp-slab .sp-slab__card { fill: Canvas; stroke: CanvasText; }
  .seal-picture__controls button { border-color: ButtonText; }
}

/* ---- Example boxes and their QR codes -------------------------------- */
.seal-examples__note { max-width: 36rem; margin: 1.5rem 0 0; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.55; }
.seal-examples { margin: 1rem 0 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line-strong); }
.seal-examples li { min-width: 0; padding: 0.85rem 0 0.2rem; border-top: 1px solid var(--line-strong); }
.seal-examples a { display: inline-block; padding-block: 0.15rem; color: var(--ink); text-underline-offset: 0.2em; overflow-wrap: anywhere; }
.seal-qr summary { display: inline-flex; align-items: center; gap: 0.55rem; min-width: 44px; min-height: 44px; padding-right: 0.75rem; color: var(--teal-ink); font-size: 0.85rem; font-weight: 600; cursor: pointer; list-style: none; }
.seal-qr summary::-webkit-details-marker { display: none; }
.seal-qr summary::before { content: ""; flex: 0 0 auto; width: 0.45rem; height: 0.45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-0.12rem) rotate(45deg); }
.seal-qr[open] summary::before { transform: translateY(0.12rem) rotate(-135deg); }
.seal-qr__panel { padding: 0.25rem 0 0.85rem; }
/* Four CSS pixels a module at full size (set on the SVG), so modules land on
   whole pixels; narrower screens scale it down. The hairline is a shadow, not a
   border: a border would shrink the drawing by two pixels and blur that grid. */
.seal-qr__code { display: block; max-width: 100%; height: auto; border-radius: 0.25rem; box-shadow: 0 0 0 1px var(--line-strong); forced-color-adjust: none; }

/* ---- The result: the line under a verdict from a saved release list --- */
.seal-result__note { margin: 0.75rem 0 0; color: var(--ink-soft); font-size: 0.875rem; line-height: 1.55; overflow-wrap: anywhere; }
.seal-result[data-state="withdrawn"] { box-shadow: inset 4px 0 0 #9b2c2c; }

/* ---- Scan the code --------------------------------------------------- */
.seal-checker .actions { flex-wrap: wrap; margin-top: 0.9rem; }
.seal-scan-note { max-width: 34rem; margin: 0.9rem 0 0; color: var(--ink-soft); font-size: 0.875rem; line-height: 1.55; }
.scan-dialog { width: min(32rem, calc(100vw - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); margin: auto; padding: 1rem; overflow: auto; color: var(--ink); background: var(--paper-bright); border: 1px solid #8fa59b; border-radius: 1rem; box-shadow: 0 1.5rem 6rem rgb(0 0 0 / 0.35); }
.scan-dialog::backdrop { background: rgb(12 26 31 / 0.86); }
.scan-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.scan-dialog__head h2 { margin: 0; font-size: 1.5rem; line-height: 1.2; }
.scan-dialog__head button { min-width: 44px; min-height: 44px; padding: 0.6rem 0.85rem; border: 1px solid #8da99c; border-radius: 0.6rem; background: #edf3e9; color: #214b48; font: inherit; font-size: 0.85rem; cursor: pointer; }
.scan-dialog__head button:hover { background: #dcebdd; border-color: #416c61; }
.scan-dialog__view { position: relative; display: grid; aspect-ratio: 1; overflow: hidden; border-radius: 0.55rem; background: var(--night); }
.scan-dialog__view:empty { display: none; }
.scan-dialog__view video { width: 100%; height: 100%; object-fit: cover; }
.scan-dialog__frame { position: absolute; inset: 14%; border: 2px solid rgb(255 255 255 / 0.9); border-radius: 0.75rem; box-shadow: 0 0 0 100vmax rgb(12 26 31 / 0.35); pointer-events: none; }
.scan-dialog__status { min-height: 3rem; margin: 0.85rem 0 0; font-size: 0.95rem; line-height: 1.5; }
.scan-dialog[data-state="error"] .scan-dialog__status { padding: 0.85rem 1rem; border-radius: 0.6rem; background: var(--paper); box-shadow: inset 4px 0 0 #9b2c2c; }
.scan-dialog__note { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
@media (forced-colors: active) {
  .scan-dialog { border-color: CanvasText; }
  .scan-dialog__frame { border-color: Highlight; box-shadow: none; }
}
