/* Archivarium components. Needs ../tokens/tokens.css.
   One rule above all: anything that inverts across the seam (.arc-dif and friends) must sit
   directly over the split. No parent between it and the frame may create its own layer
   (z-index, transform, opacity < 1, filter, isolation), or it renders plain white. */

/* ---------- frame: the split ---------- */
.arc-frame{position:relative;overflow:hidden;isolation:isolate;background:var(--arc-split);container-type:size}
.arc-frame--grain::after{content:"";position:absolute;inset:0;pointer-events:none;z-index:5;opacity:var(--arc-grain-opacity);mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}
/* a whole page on the split (website) */
.arc-page{background:var(--arc-split) fixed;min-height:100vh}

/* ---------- inverting things ---------- */
.arc-dif{color:var(--arc-invert);mix-blend-mode:difference}
.arc-wordmark{display:block;aspect-ratio:3408/890;background:var(--arc-invert);mix-blend-mode:difference;
  -webkit-mask:url("../../logo/avm-signature-bone.svg") center/contain no-repeat;
          mask:url("../../logo/avm-signature-bone.svg") center/contain no-repeat}
.arc-title{font-family:var(--arc-font-title);font-weight:400;text-transform:uppercase;font-variant-ligatures:common-ligatures discretionary-ligatures contextual;
  line-height:1;color:var(--arc-invert);mix-blend-mode:difference;margin:0}
.arc-heading{font-family:var(--arc-font-heading);font-weight:var(--arc-weight-heading);color:var(--arc-invert);mix-blend-mode:difference;margin:0}
.arc-body{font-family:var(--arc-font-body);font-weight:var(--arc-weight-body);color:var(--arc-invert);mix-blend-mode:difference;margin:0}
.arc-label{font-family:var(--arc-font-label);font-weight:400;font-size:var(--arc-size-label);letter-spacing:var(--arc-tracking-label);color:var(--arc-invert);mix-blend-mode:difference;margin:0}
.arc-credo{font-family:var(--arc-font-devanagari);font-weight:900;color:var(--arc-invert);mix-blend-mode:difference;margin:0;line-height:1.3}
/* a record's own title lettering, flattened to one colour */
.arc-lockup{display:block;background:var(--arc-invert);mix-blend-mode:difference;
  -webkit-mask:var(--arc-src) center/contain no-repeat;mask:var(--arc-src) center/contain no-repeat}

/* ---------- the paper (bone half only) ---------- */
/* Arc.paper() builds it. The mask isolates the layer, so it carries its own bone for the blends to work on.
   These masks fit the default 12° seam; Arc.seam() replaces them for any other seam. */
.arc-paper{position:absolute;inset:0;pointer-events:none;background:var(--arc-bone);
  -webkit-mask:var(--arc-mask-bone);mask:var(--arc-mask-bone)}
.arc-paper>svg,.arc-paper>i{position:absolute;inset:0;width:100%;height:100%;display:block}
.arc-paper__mul,.arc-paper__fibres{mix-blend-mode:multiply}
.arc-paper__soft{mix-blend-mode:soft-light}

/* ---------- the film (ink half only) ---------- */
/* Arc.film() builds it. Carries its own ink, like the paper carries bone. */
.arc-film{position:absolute;inset:0;pointer-events:none;background:var(--arc-ink);
  -webkit-mask:var(--arc-mask-ink);mask:var(--arc-mask-ink)}
.arc-film>svg,.arc-film>i{position:absolute;inset:0;width:100%;height:100%;display:block;mix-blend-mode:screen}

/* ---------- the gate ---------- */
svg.arc-gate{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);overflow:visible;pointer-events:none}
svg.arc-gate path{fill:none;stroke:currentColor}
/* ink half: a light scratch in the film, worn like the bone line */
svg.arc-gate--ink{color:var(--arc-gate-ink);opacity:var(--arc-gate-ink-opacity);mix-blend-mode:screen;-webkit-mask:var(--arc-mask-ink);mask:var(--arc-mask-ink)}
svg.arc-gate--ink path{stroke-width:1;filter:url(#arc-gate-worn)}
/* bone half: a worn rust line, as if drawn by hand */
svg.arc-gate--bone{color:var(--arc-gate-bone);opacity:var(--arc-gate-bone-opacity);mix-blend-mode:multiply;-webkit-mask:var(--arc-mask-bone);mask:var(--arc-mask-bone)}
svg.arc-gate--bone path{stroke-width:1.4;filter:url(#arc-gate-worn)}

/* ---------- the record box ---------- */
.arc-box{display:block;box-sizing:border-box;background:var(--arc-split-reversed);padding:calc(var(--arc-box-w) * var(--arc-box-border));width:var(--arc-box-w)}
.arc-box__art{position:relative;aspect-ratio:1;overflow:hidden}
.arc-box__art img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.arc-box__mono{clip-path:var(--arc-mono-clip,inset(0 50% 0 0));transition:clip-path var(--arc-reveal-ms) var(--arc-ease)}
.arc-box--full .arc-box__mono{clip-path:var(--arc-mono-clip-full,inset(0 100% 0 0))}
.arc-box--live{cursor:pointer}
.arc-box--live:hover .arc-box__mono,.arc-box--live:focus-visible .arc-box__mono{clip-path:var(--arc-mono-clip-full,inset(0 100% 0 0))}
.arc-box--live:focus-visible{outline:1px solid var(--arc-invert);outline-offset:4px}
.arc-mono-luminance{filter:grayscale(1) contrast(1.15)}
.arc-mono-red{filter:url(#arc-mono-red) contrast(1.1)}
.arc-mono-gold{filter:url(#arc-mono-gold) contrast(1.15)}

/* ---------- ornaments (behind content) ---------- */
.arc-ornaments{position:fixed;inset:0;pointer-events:none}
.arc-ornament{position:absolute;left:50%;top:50%;width:min(78vh,64vw);aspect-ratio:1;mix-blend-mode:difference;opacity:0;will-change:transform,opacity}
.arc-ornament i,.arc-ornament--static i{position:absolute;inset:0;background:var(--arc-invert);
  -webkit-mask:var(--arc-src) center/contain no-repeat;mask:var(--arc-src) center/contain no-repeat}
.arc-ornament--static{position:absolute;left:50%;top:50%;aspect-ratio:1;mix-blend-mode:difference;opacity:var(--arc-ornament-peak)}
/* in a frame: drawn once per half (Arc.ornament), light on ink like the scratched gate, rust on bone like the bone gate.
   The half is a still, full-frame wrapper with the mask; the emblem inside it can turn and move freely. */
.arc-orn{position:absolute;inset:0;pointer-events:none;opacity:var(--arc-orn-o,var(--arc-ornament-peak))}
.arc-orn>i{position:absolute;left:50%;top:50%;aspect-ratio:1;background:currentColor;
  -webkit-mask:var(--arc-src) center/contain no-repeat;mask:var(--arc-src) center/contain no-repeat}
.arc-orn--ink{color:var(--arc-ornament-ink);mix-blend-mode:screen;-webkit-mask:var(--arc-mask-ink);mask:var(--arc-mask-ink)}
.arc-orn--bone{color:var(--arc-ornament-bone);mix-blend-mode:multiply;-webkit-mask:var(--arc-mask-bone);mask:var(--arc-mask-bone)}

@media (prefers-reduced-motion:reduce){.arc-box__mono{transition:none}}
