/* KYBER-CODEX ∴ NEURO-SHAMAN'S DECK
 * Design law inherited from the Octagram Oracle spec:
 *   math meets intuition · form from the formless · code converts to image
 * archaic-futuristic · CRT · never pastel · never skeuomorphic-mystical
 */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Exo+2:ital,wght@1,300;1,400&family=JetBrains+Mono:wght@300;400;500;700&family=Space+Mono:wght@400;700&family=VT323&display=swap');

:root{
  --void:        #08080b;
  --plate-a:     #0a0e14;
  --plate-b:     #100a16;
  --plate-c:     #140912;
  --ink:         #e8f4f0;
  --text:        #e6f7ff;
  --beige:       #dfd2b4;

  --cyan:        #00eaff;
  --magenta:     #ff2bd6;
  --violet:      #9d4bff;
  --acid:        #39ff14;
  --hot:         #ff10a0;
  --azure:       #2b8bff;
  --amber:       #ff9a3c;
  --amber-warm:  #ffb257;

  --crt-red:  rgba(255, 0, 90, .85);
  --crt-cyan: rgba( 0,220,255, .85);
  --crt-amber: rgba(255,154,60,.9);
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{background:var(--void);color:var(--text);font-family:'JetBrains Mono',monospace;line-height:1.5;overflow-x:hidden}
body{
  min-height:100vh;
  background:
    radial-gradient(1200px 800px at 15% -5%, rgba(0,234,255,.06), transparent 60%),
    radial-gradient(1000px 700px at 85% 105%, rgba(255,43,214,.05), transparent 60%),
    radial-gradient(700px 500px at 50% 50%, rgba(157,75,255,.03), transparent 70%),
    var(--void);
}

/* ---------- CRT scan-noise page background ---------- */
body::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:1;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.014) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,234,255,.008) 0 1px, transparent 1px 4px);
  mix-blend-mode:screen;
}
body::after{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:2;
  background:radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0,0,0,.55) 100%);
}

/* ==================================================================
 *  HERO
 * ================================================================== */
.hero{
  position:relative;z-index:3;
  padding:80px 32px 40px;
  display:grid;place-items:center;text-align:center;
  min-height:70vh;
}
/* The instrument. container-type lets the orbit radius be written in cqw so it tracks the box. */
.hero .octagram{
  width:min(360px, 40vw);aspect-ratio:1;
  position:relative;margin-bottom:76px;   /* the orbit rides 2cqw past the box plus half a rider; keep it off the eyebrow */
  container-type:size;
  filter:drop-shadow(0 0 20px rgba(0,234,255,.35)) drop-shadow(0 0 40px rgba(157,75,255,.15));
}
@media (max-width:1023px){ .hero .octagram{ width:min(320px, 55vw); } }
@media (max-width:639px){ .hero .octagram{ width:min(300px, 78vw); margin-bottom:64px; } }
/* The base SVG no longer spins: the eight phase glyphs sit on its vertices and must stay put. Motion moved to the orbit. */
.hero .octagram svg{width:100%;height:100%;display:block}
.hero .octagram svg [pathLength]{ stroke-dasharray:1; stroke-dashoffset:0; transition:stroke-dashoffset .7s cubic-bezier(.2,.9,.2,1); }
.hero .octagram::after{
  content:"";position:absolute;inset:20%;
  background:radial-gradient(circle at 50% 50%, rgba(0,234,255,.35), transparent 60%);
  animation:breathe 6s ease-in-out infinite;border-radius:50%;pointer-events:none;
}
/* layers */
.hero-ticks,.hero-phases,.hero-orbit,.hero-core,.hero-bootlog-slot{ position:absolute; inset:0; }
.hero-ticks,.hero-phases,.hero-bootlog-slot{ pointer-events:none; }
.hero-ticks i{
  position:absolute;left:50%;top:50%;width:10px;height:10px;margin:-5px 0 0 -5px;
  display:grid;place-items:center;font:400 10px/1 'JetBrains Mono',monospace;font-style:normal;color:var(--beige);opacity:.35;
  transform:rotate(var(--a)) translateY(-46cqw) rotate(calc(var(--a) * -1));
}
.hero-phases b{
  position:absolute;left:50%;top:50%;width:22px;height:22px;margin:-11px 0 0 -11px;
  display:grid;place-items:center;font:400 14px/1 'JetBrains Mono',monospace;
  color:var(--hue);text-shadow:0 0 8px var(--hue);pointer-events:auto;cursor:pointer;
  transform:rotate(var(--a)) translateY(-40cqw) rotate(calc(var(--a) * -1));
}
.hero-phases b::after{
  content:attr(data-tip);position:absolute;top:26px;left:50%;transform:translateX(-50%);
  white-space:nowrap;font:400 9px/1 'JetBrains Mono',monospace;letter-spacing:.14em;color:var(--beige);
  opacity:0;transition:opacity .2s;pointer-events:none;
}
.hero-phases b:hover::after{ opacity:.85; }
/* the orbit: the ring rotates, every rider counter-rotates on the same clock so the gods stay upright */
.hero-orbit{ animation:hero-orbit 120s linear infinite; }
.hero-orbit a{
  position:absolute;left:50%;top:50%;width:64px;height:64px;margin:-32px 0 0 -32px;display:block;
  transform:rotate(var(--a)) translateY(-52cqw) rotate(calc(var(--a) * -1));
}
.hero-orbit a img{
  width:100%;height:100%;object-fit:contain;display:block;
  filter:drop-shadow(0 0 6px rgba(0,234,255,.25));transition:filter .25s, transform .25s;
  animation:hero-orbit 120s linear infinite reverse;
}
.hero-orbit:hover, .hero-orbit:hover a img{ animation-play-state:paused; }
.hero-orbit a:hover img{ transform:scale(1.18); filter:drop-shadow(0 0 10px var(--cyan)) drop-shadow(0 0 22px var(--magenta)); }
@media (max-width:1023px){ .hero-orbit a{ width:52px;height:52px;margin:-26px 0 0 -26px; } }
@media (max-width:639px){ .hero-ticks{ display:none; } }
.hero-core{ inset:27%; }
.hero-core canvas, .hero-core img{ width:100%;height:100%;display:block;object-fit:contain; }
.hero-core img{ opacity:.9;filter:drop-shadow(0 0 10px var(--cyan)); }
/* boot log over the instrument, same family as .card .bootlog */
.hero .bootlog{
  position:absolute;inset:8%;margin:0;overflow:hidden;pointer-events:none;text-align:left;
  font:11px/1.6 'VT323','JetBrains Mono',monospace;letter-spacing:.08em;color:var(--acid,#39ff14);
  text-shadow:0 0 6px rgba(57,255,20,.6);white-space:pre-wrap;
  background:repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,0,0,.35) 2px 3px), rgba(8,8,11,.85);
}
.hero .bootlog::after{ content:"█"; animation:boot-cursor .5s steps(1) infinite; }
/* type */
.hero h1{
  font-family:'Orbitron',sans-serif;font-weight:900;
  font-size:clamp(28px, 6.5vw, 76px);
  letter-spacing:.24em;
  color:var(--ink);
  text-shadow: -2px 0 var(--crt-red), 2px 0 var(--crt-cyan), 0 0 40px rgba(0,234,255,.2);
  margin-bottom:12px;line-height:1.05;
}
.hero .tagline{
  font-family:'Exo 2',sans-serif;font-style:italic;font-weight:300;
  font-size:clamp(14px, 2vw, 20px);color:var(--beige);letter-spacing:.06em;
  max-width:820px;margin:0 auto 8px;
}
.hero .creed{
  font-family:'JetBrains Mono',monospace;font-size:12px;color:var(--cyan);
  letter-spacing:.35em;opacity:.7;margin-top:20px;
}
.hero-rail{
  display:flex;flex-wrap:wrap;justify-content:center;gap:6px 0;margin-top:14px;max-width:900px;
  font-family:'JetBrains Mono',monospace;font-size:11px;letter-spacing:.18em;color:var(--cyan);opacity:.75;
}
.hero-rail a{ color:inherit;text-decoration:none;padding:4px 6px;transition:color .2s; }
.hero-rail a:hover, .hero-rail a:focus-visible{ color:var(--magenta); }
.hero-rail a + a::before{ content:"·";margin-right:12px;color:var(--beige);opacity:.5; }
.hero .sub{
  font-family:'JetBrains Mono',monospace;font-size:11px;color:var(--beige);
  letter-spacing:.18em;opacity:.65;margin-top:6px;
}
.hero-recompile{
  position:absolute;right:24px;bottom:16px;min-height:44px;padding:0 12px;
  background:transparent;border:1px solid rgba(0,234,255,.25);color:var(--cyan);cursor:pointer;
  font:500 10px/1 'JetBrains Mono',monospace;letter-spacing:.2em;opacity:.55;transition:opacity .2s;
}
.hero-recompile:hover{ opacity:1; }
@media (max-width:1023px){ .hero-recompile{ position:static;margin-top:18px; } }
/* ---- compile stages. Booting hides everything but the log; each stage reveals a layer. ---- */
.hero.is-booting .octagram svg [pathLength]{ stroke-dashoffset:1; transition:none; }
.hero.is-booting .hero-phases b, .hero.is-booting .hero-ticks i, .hero.is-booting .hero-core,
.hero.is-booting .eyebrow, .hero.is-booting h1, .hero.is-booting .tagline, .hero.is-booting .creed,
.hero.is-booting .hero-rail, .hero.is-booting .sub, .hero.is-booting .hero-recompile{ opacity:0; }
.hero.is-booting .hero-orbit{ animation:none; }
.hero.is-booting .hero-orbit a{ transform:translate(0,0) scale(.2); opacity:0; }
.hero.is-booting .octagram::after{ animation:none; opacity:0; }
/* st-draw: strokes draw, glyphs snap (JS adds .on per glyph on the beat) */
.hero.st-draw .octagram svg [pathLength]{ stroke-dashoffset:0; transition:stroke-dashoffset .7s cubic-bezier(.2,.9,.2,1); }
.hero.st-draw .hero-phases b{ transition:opacity .12s, transform .12s; }
.hero.st-draw .hero-phases b.on{ opacity:1; }
/* st-fan: riders fly to the ring */
.hero.st-fan .hero-orbit a{ transition:transform .6s cubic-bezier(.2,.9,.2,1), opacity .3s; transition-delay:var(--d); opacity:1;
  transform:rotate(var(--a)) translateY(-52cqw) rotate(calc(var(--a) * -1)); }
.hero.st-fan .hero-orbit a.glitch img{ animation:boot-rgb .18s steps(1) 1; }
/* the log dims once the riders fan and is gone before the core appears, as the card boot does */
.hero.st-fan .bootlog{ opacity:.35; transition:opacity .3s; }
.hero.st-core .bootlog{ opacity:0; }
/* st-core: wireframe + ticks up */
.hero.st-core .hero-core{ opacity:1; transition:opacity .6s; }
.hero.st-core .hero-ticks i{ opacity:.35; transition:opacity .5s; }
/* st-title: type materialises */
.hero.st-title h1{ opacity:1; animation:boot-pop .4s cubic-bezier(.2,.9,.2,1) 1; }
.hero.st-title .eyebrow, .hero.st-title .tagline, .hero.st-title .creed, .hero.st-title .hero-rail, .hero.st-title .sub, .hero.st-title .hero-recompile{ opacity:1; transition:opacity .5s; }
.hero.st-title .octagram::after{ opacity:1; transition:opacity .6s; }
/* is-locked: final resting state, orbit drifting */
.hero.is-locked .hero-orbit a{ opacity:1; transition:none; }
.hero.is-locked .hero-core{ opacity:1; }
/* reduced motion: locked, still */
.hero.is-reduced .hero-orbit, .hero.is-reduced .hero-orbit a img, .hero.is-reduced .octagram::after{ animation:none; }
@keyframes hero-orbit{ to{ transform:rotate(360deg); } }

/* ==================================================================
 *  SECTION SHELL
 * ================================================================== */
section{position:relative;z-index:3;padding:60px 32px}
.wrap{max-width:1400px;margin:0 auto}
.eyebrow{
  font-family:'JetBrains Mono',monospace;font-size:11px;letter-spacing:.4em;
  color:var(--cyan);opacity:.75;margin-bottom:8px;
}
.eyebrow::before{content:"◉ ";color:var(--magenta)}
.section-title{
  font-family:'Orbitron',sans-serif;font-weight:700;
  font-size:clamp(22px, 3.5vw, 40px);letter-spacing:.18em;
  color:var(--ink);margin-bottom:12px;
  text-shadow:-1.4px 0 var(--crt-red), 1.4px 0 var(--crt-cyan);
}
.section-lede{
  font-family:'Exo 2',sans-serif;font-style:italic;font-weight:300;
  font-size:clamp(15px, 1.7vw, 19px);color:var(--beige);max-width:780px;
  margin-bottom:40px;line-height:1.6;
}

/* ==================================================================
 *  PHASE-WHEEL
 * ================================================================== */
.phase-wheel{
  display:grid;grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
  gap:14px;margin-bottom:32px;
}
.phase{
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(168deg, rgba(10,14,20,.9), rgba(20,9,18,.9));
  padding:20px 18px;position:relative;
  transition:border-color .3s, transform .3s;
}
.phase:hover{border-color:var(--phase-hue);transform:translateY(-2px)}
.phase .g{font-size:36px;line-height:1;color:var(--phase-hue);
  text-shadow:0 0 12px var(--phase-hue), -1.2px 0 var(--crt-red), 1.2px 0 var(--crt-cyan);}
.phase .id{
  font-family:'Orbitron',sans-serif;font-weight:700;font-size:13px;
  letter-spacing:.3em;color:var(--ink);margin:10px 0 6px;
}
.phase .m{font-family:'Exo 2',sans-serif;font-style:italic;font-size:13px;color:var(--beige);opacity:.85;line-height:1.5}
.phase .idx{
  position:absolute;top:10px;right:12px;font-family:'JetBrains Mono',monospace;
  font-size:10px;color:var(--phase-hue);opacity:.6;letter-spacing:.15em;
}

/* ==================================================================
 *  SIGIL GRAMMAR (Card Language)
 * ================================================================== */
.grammar{
  display:grid;grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
  gap:12px;
}
.prim{
  border:1px solid rgba(154,223,255,.14);
  background:radial-gradient(circle at 30% 20%, rgba(0,234,255,.06), rgba(8,8,11,.85) 65%);
  padding:18px;display:grid;grid-template-columns:56px 1fr;gap:14px;align-items:center;
  position:relative;overflow:hidden;
}
.prim::before{
  content:"";position:absolute;top:0;left:0;width:3px;height:100%;
  background:linear-gradient(180deg, var(--cyan), var(--magenta));opacity:.5;
}
.prim .glyph{
  font-family:'JetBrains Mono',monospace;font-size:38px;line-height:1;color:var(--cyan);
  text-align:center;
  text-shadow:-1.6px 0 var(--crt-red), 1.6px 0 var(--crt-cyan), 0 0 14px rgba(0,234,255,.5);
}
.prim .nm{font-family:'Orbitron',sans-serif;font-weight:700;font-size:12px;
  letter-spacing:.24em;color:var(--ink)}
.prim .r{font-family:'Exo 2',sans-serif;font-style:italic;font-size:12px;
  color:var(--beige);opacity:.85;margin-top:4px;line-height:1.45}

/* ==================================================================
 *  THE CARD — layered per spec
 *  aspect 0.6065 portrait; radius 10px
 * ================================================================== */
.deck{
  display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
  gap:32px 24px;padding-top:8px;
}

.card{
  --w: 100%;
  aspect-ratio: 0.6065;
  position:relative;border-radius:10px;overflow:hidden;
  background:
    linear-gradient(168deg, #0a0e14, #100a16 55%, #140912);
  isolation:isolate;
  cursor:pointer;
  transition:transform .5s cubic-bezier(.2,.6,.2,1);
}
.card:hover{transform:translateY(-6px) rotateX(2deg) rotateY(-1deg)}

/* 2. Background weather — per-card variation via --card-* vars */
.card .sphere{
  position:absolute;inset:-10% -20%;background-repeat:no-repeat;background-size:cover;background-position:center;
  opacity:calc(.32 * var(--card-sphere-op, 1));
  filter:blur(2px) saturate(var(--card-sat, 1)) brightness(var(--card-bright, 1));
  z-index:1;
  animation:sphere-drift 60s ease-in-out infinite alternate;
  animation-delay:var(--card-sphere-delay, 0s);
}
.card .vortex{
  /* Broad textured field: keep the art's own colour (vortex.png ships as
     #00eaff = --cyan). Masking a flat token over this much coverage floods
     the card; only thin linework layers get the mask+token treatment. */
  position:absolute;inset:-30%;background:url('/assets/geometry/vortex.png') center/contain no-repeat;
  opacity:calc(.06 * var(--card-vortex-op, 1));z-index:0;
  animation:spin-cw var(--card-vortex-dur, 96s) linear infinite;
  filter:saturate(var(--card-sat, 1));
}
.card .orbits{
  position:absolute;inset:8%;background:url('/assets/marks/orbits.png') center/contain no-repeat;
  opacity:calc(.22 * var(--card-orbit-op, 1));z-index:2;
  animation:spin-cw var(--card-orbit-dur, 24s) linear infinite;
  animation-direction:var(--card-orbit-dir, normal);
  filter:saturate(var(--card-sat, 1)) brightness(var(--card-bright, 1));
}
.card .spiro{
  /* art ships as #ff2bd6 = --magenta; keep native colour */
  position:absolute;inset:14%;background:url('/assets/geometry/spiro.png') center/contain no-repeat;
  opacity:calc(.10 * var(--card-spiro-op, 1));z-index:2;
  animation:spin-ccw var(--card-spiro-dur, 48s) linear infinite;
  animation-direction:var(--card-spiro-dir, normal);
  mix-blend-mode:screen;
}

/* 3. Art aperture — dot lattice + arcana stamp
   Extended DOWN through the barcode strip so the god image pierces it.
   Bottom now cropped where the turquoise corner guides are (~3% margin). */
.card .aperture{
  position:absolute;top:5.2%;left:8%;right:8%;bottom:3%;
  z-index:3;
  background:
    radial-gradient(rgba(154,223,255,.10) 1px, transparent 1.4px) 0 0 / 16px 16px;
  /* Octagon / elongated-playing-card clip — corners trimmed with matching margin */
  clip-path: polygon(
    12px 0%, calc(100% - 12px) 0%,
    100% 12px, 100% calc(100% - 12px),
    calc(100% - 12px) 100%, 12px 100%,
    0% calc(100% - 12px), 0% 12px
  );
  display:grid;place-items:center;
}
.card .aperture img.art{
  max-width:103%;max-height:103%;
  transform:scale(1.07);
  transform-origin:center;
  filter:drop-shadow(-1.6px 0 rgba(255,0,90,.6)) drop-shadow(1.6px 0 rgba(0,220,255,.6))
         drop-shadow(0 0 14px rgba(0,234,255,.4));
  opacity:.94;
}
/* Painted portrait variant: full-bleed painted tarot art, no RGB split */
.card.painted .aperture{
  background:transparent;
  overflow:hidden;
  border-radius:6px;
  z-index:2; /* Below animated overlay layers (see below) */
}
.card.painted .aperture img.art{
  width:100%;height:100%;
  max-width:none;max-height:none;
  object-fit:cover;
  transform:none;
  filter:drop-shadow(0 0 10px rgba(0,234,255,.28));
  opacity:1;
  mix-blend-mode:normal;
}

/* UNIFIED ATMOSPHERE: everything blends into one continuous painterly field.
   Portrait full-bleed; animations subtle, transparent, softly luminous.
   You can feel motion on different planes, but no layer reads as a distinct
   sticker sitting on top of another. All layers share screen blend + soft-light
   accents, and a global atmospheric haze unifies the composition. */

/* Ambient bg layers — subtle, blended, kept BEHIND the portrait */
/* FULLBLEED path: soft-light against painting works well */
.card.painted.fullbleed .vortex{
  z-index:2; opacity:.28; mix-blend-mode:soft-light;
  filter:blur(1px) saturate(.7);
  pointer-events:none;
}
.card.painted.fullbleed .sphere{
  z-index:2; opacity:.32; mix-blend-mode:soft-light;
  filter:blur(4px) saturate(.6);
  pointer-events:none;
}
/* z-index:6 put these IN FRONT of the god (aperture z:4). Animated layers all
   sit behind the character and its glow — see the .cutout note above. */
.card.painted.fullbleed .orbits{
  z-index:2; opacity:.18; mix-blend-mode:screen;
  filter:blur(.4px) saturate(.85);
  pointer-events:none;
}
.card.painted.fullbleed .spiro{
  z-index:2; opacity:.14; mix-blend-mode:screen;
  filter:blur(.5px) saturate(.75);
  pointer-events:none;
}
.card.painted.fullbleed .mark{
  z-index:7; opacity:.35; mix-blend-mode:screen;
}

/* CUTOUT path: the god has transparent bg, so ambient layers show FULL strength
   against the dark card substrate. Dial way back so they read as atmosphere
   not as loud stickers. Desaturate hard; screen against dark still gives glow. */
.card.painted.cutout .vortex{
  z-index:2; opacity:.10; mix-blend-mode:screen;
  filter:blur(2px) saturate(.35) brightness(.85);
  pointer-events:none;
}
.card.painted.cutout .sphere{
  z-index:2; opacity:.14; mix-blend-mode:screen;
  filter:blur(6px) saturate(.35);
  pointer-events:none;
}
/* orbits/spiro were z-index:6 — IN FRONT of the god (aperture z:4), so the
   rings drew across the character's chest and shield. Every animated layer
   belongs BEHIND the character and its outline glow. */
.card.painted.cutout .orbits{
  z-index:2; opacity:.13; mix-blend-mode:screen;
  filter:blur(.6px) saturate(.55);
  pointer-events:none;
}
.card.painted.cutout .spiro{
  z-index:2; opacity:.10; mix-blend-mode:screen;
  filter:blur(.7px) saturate(.5);
  pointer-events:none;
}
.card.painted.cutout .mark{
  z-index:7; opacity:.28; mix-blend-mode:screen;
}

/* Two paths for painted portraits:
   1. .cutout — keyed transparent-bg portrait; ambient layers show through fully.
   2. .fullbleed — painted portrait with its own composed background; blended
      into the card via atmospheric wash and vignette dissolve. */

.card.painted .aperture{ background:transparent; z-index:3; }

/* PATH 1: CUTOUT PORTRAITS — clean subject on transparent alpha.
   NOTE: do NOT add an edge/vignette mask here. A later rule deliberately sets
   mask-image:none on keyed bodies ("never vignette-mask a keyed body") — the
   silhouette is already the edge, so masking it clips the figure. */
.card.painted.cutout .aperture img.art{
  filter:
    drop-shadow(-1px 0 rgba(255,0,90,.35))
    drop-shadow( 1px 0 rgba(0,220,255,.35))
    drop-shadow(0 0 22px rgba(0,234,255,.35))
    drop-shadow(0 4px 14px rgba(0,0,0,.55));
  opacity:1;
}

/* PATH 2: FULLBLEED PAINTED — dark-bg painting blended into card atmosphere */
.card.painted.fullbleed .aperture img.art{
  -webkit-mask-image: radial-gradient(ellipse 96% 100% at 50% 48%,
    #000 68%, rgba(0,0,0,.92) 82%, rgba(0,0,0,.6) 92%, rgba(0,0,0,.2) 98%, transparent 100%);
          mask-image: radial-gradient(ellipse 96% 100% at 50% 48%,
    #000 68%, rgba(0,0,0,.92) 82%, rgba(0,0,0,.6) 92%, rgba(0,0,0,.2) 98%, transparent 100%);
  filter:
    contrast(1.02) saturate(.95) brightness(.98)
    drop-shadow(-1px 0 rgba(255,0,90,.25))
    drop-shadow( 1px 0 rgba(0,220,255,.25))
    drop-shadow(0 0 22px rgba(0,234,255,.14));
  opacity:1;
}

/* Atmospheric haze — a single soft luminosity wash tying every layer together */
.card.painted::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:4;
  pointer-events:none;
  background:
    radial-gradient(120% 90% at 30% 30%, rgba(0,234,255,.10), transparent 55%),
    radial-gradient(110% 80% at 75% 75%, rgba(255,43,214,.08), transparent 55%),
    radial-gradient(100% 70% at 50% 50%, rgba(157,75,255,.05), transparent 65%);
  mix-blend-mode:soft-light;
  animation:atmosphere-drift 24s ease-in-out infinite alternate;
}
.card.painted::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:5;
  pointer-events:none;
  background:
    linear-gradient(160deg, rgba(255,255,255,.04) 0%, transparent 40%, rgba(0,0,0,.15) 100%);
  mix-blend-mode:overlay;
}
@keyframes atmosphere-drift{
  0%   { transform:translate(0,0) scale(1); }
  100% { transform:translate(-2%,1%) scale(1.05); }
}

/* Cutout variant: the painted image has a transparent background, so the god
   floats ABOVE the weather and the weather reads through behind the body.
   NOTE: the per-layer opacity/blend values for .cutout live in the tuned block
   further up ("atmosphere not stickers"). An older TEST B block used to sit
   here and silently overrode them ~9x, which is why the layers read as loud
   stickers rather than weather. Only stacking order belongs here now. */
.card.painted.cutout .aperture{
  background:transparent;
  z-index:4;              /* god sits above the ambient layers */
}

/* TEST C helper: feather mask for softer edges. NOTE: orphaned — no element
   ever gets .feather-mask. Superseded by the burn-through masks now applied
   directly on the .cutout and .fullbleed paths above. Kept pending review. */
.card.painted.feather-mask .aperture img.art{
  -webkit-mask-image: radial-gradient(ellipse 78% 92% at 50% 50%, black 55%, rgba(0,0,0,0.75) 78%, transparent 100%);
  mask-image: radial-gradient(ellipse 78% 92% at 50% 50%, black 55%, rgba(0,0,0,0.75) 78%, transparent 100%);
}

/* 4. Frame */
.card .frame{
  position:absolute;inset:0;
  background:url('/assets/frame/frame-crop.png') center/100% 100% no-repeat;
  opacity:.95;pointer-events:none;z-index:5;
}

/* 5. Breathing edge */
.card .edge{
  position:absolute;inset:0;border-radius:10px;pointer-events:none;z-index:6;
  border:1px solid var(--cyan);
  animation:edge-cycle 90s linear infinite;
  box-shadow:inset 0 0 24px rgba(0,234,255,.15);
}

/* 6. Data layer — chunky-mono CRT typography (Space Mono / VT323) */
.card .register{
  position:absolute;top:2.1%;left:15%;right:15%;
  display:flex;justify-content:space-between;align-items:center;gap:8px;
  font-family:'Space Mono',ui-monospace,monospace;font-weight:700;font-size:8.5px;letter-spacing:.16em;
  color:var(--ink);z-index:7;
  text-shadow:-2.4px 0 var(--crt-red), 2.4px 0 var(--crt-cyan), 0 0 3px rgba(255,154,60,.15);
}
.card .register .arc{opacity:.9;color:var(--amber);text-shadow:-2.4px 0 var(--crt-red), 2.4px 0 var(--crt-cyan)}
.card .register .bar{
  flex:1;height:8px;
  background:repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 2px,
    var(--ink) 2px 4px, transparent 4px 5px, var(--ink) 5px 7px, transparent 7px 10px);
  opacity:.6;
  animation:barcode-slide 8s linear infinite;
}
.card .register .bin{opacity:.8}
.card .register .blip{color:var(--amber);animation:blink 1.4s steps(2) infinite;text-shadow:0 0 4px var(--crt-amber)}

/* Banner */
.card .banner{
  position:absolute;top:88.8%;left:8%;right:8%;
  z-index:7;text-align:center;
  color:var(--ink);
  /* Solid backdrop so the newly-piercing god image never obstructs the name/title */
  background: linear-gradient(180deg, rgba(2,8,14,0) 0%, rgba(2,8,14,0.82) 22%, rgba(2,8,14,0.94) 50%, rgba(2,8,14,0.82) 78%, rgba(2,8,14,0) 100%);
  padding: 6px 4px 4px;
  border-radius: 2px;
}
.card .banner .row{
  display:flex;justify-content:space-between;align-items:center;
  font-family:'Space Mono',ui-monospace,monospace;font-weight:700;font-size:8.5px;letter-spacing:.14em;opacity:.9;
  margin-bottom:2px;
  text-shadow:-2.2px 0 var(--crt-red), 2.2px 0 var(--crt-cyan);
}
.card .banner .row .l{color:var(--amber)}
.card .banner .nm{
  font-family:'Space Mono',ui-monospace,monospace;font-weight:700;
  font-size:12.5px;letter-spacing:.18em;text-indent:.18em;color:var(--ink);
  text-shadow:-3px 0 var(--crt-red), 3px 0 var(--crt-cyan), 0 0 6px rgba(255,154,60,.2);
  animation:jitter 3s steps(6) infinite;
}
.card .banner .sub{
  font-family:'Space Mono',ui-monospace,monospace;font-weight:700;
  font-size:7.5px;letter-spacing:.18em;color:var(--amber);opacity:.9;
  margin-top:2px;
  text-shadow:-1.4px 0 var(--crt-red), 1.4px 0 var(--crt-cyan);
}
.card .banner .glyphs{
  display:flex;justify-content:space-between;align-items:center;
  margin-top:3px;font-size:9px;color:var(--ink);opacity:.85;letter-spacing:.12em;
  font-family:'Space Mono',ui-monospace,monospace;font-weight:700;
  text-shadow:-1.8px 0 var(--crt-red), 1.8px 0 var(--crt-cyan);
}

.card .barcode2{
  position:absolute;top:85.5%;left:22%;right:22%;height:6px;z-index:7;
  background:repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 3px);
  opacity:.85;animation:barcode-slide 12s linear infinite reverse;
  /* Sit above the god image which now pierces down through this row */
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 3px rgba(255,180,60,.5));
}

.card .footer{
  position:absolute;bottom:2%;left:8%;right:8%;
  display:flex;justify-content:space-between;align-items:center;gap:6px;
  font-family:'Space Mono',ui-monospace,monospace;font-weight:700;font-size:8px;letter-spacing:.14em;
  color:var(--ink);opacity:.85;z-index:7;
  text-shadow:-1.8px 0 var(--crt-red), 1.8px 0 var(--crt-cyan);
}
.card .footer .omega{color:var(--amber);font-size:7.5px;letter-spacing:.1em}
.card .footer .m{
  width:14px;height:14px;
  background:url('/assets/marks/matrix.png') center/contain no-repeat;
  filter:invert(1);opacity:.55;
}

/* Vertical micro-type rails — VT323 scrolling readouts */
.card .rail{
  position:absolute;top:6%;bottom:14%;width:14px;z-index:7;
  writing-mode:vertical-rl;text-orientation:mixed;
  font-family:'VT323',ui-monospace,monospace;font-size:12px;letter-spacing:.08em;
  color:var(--amber);opacity:.6;
  overflow:hidden;white-space:nowrap;
  text-shadow:-1.2px 0 var(--crt-red), 1.2px 0 var(--crt-cyan);
}
.card .rail.l{left:2%}
.card .rail.r{right:2%}

/* Beige margin marks — per-card tint via card vars */
.card .mark{
  position:absolute;width:26px;height:26px;background-size:contain;background-repeat:no-repeat;
  z-index:7;opacity:calc(.75 * var(--card-mark-op, 1));
  filter:saturate(var(--card-sat, 1)) brightness(var(--card-bright, 1));
}

/* Telemetry column (sector, seeker, cycle) inside aperture */
.card .telemetry{
  position:absolute;top:8%;right:10%;
  font-family:'Space Mono',ui-monospace,monospace;font-weight:700;font-size:8.5px;letter-spacing:.14em;
  color:var(--amber);opacity:.95;text-align:right;z-index:6;
  text-shadow:-2px 0 var(--crt-red), 2px 0 var(--crt-cyan);
}
.card .telemetry b{color:var(--cyan);font-weight:700;letter-spacing:.2em}
.card .telemetry .row2{color:var(--acid);opacity:.85;margin-top:3px;font-size:8px}

/* Sigil trio row — the card's opcode */
.card .sigil-row{
  position:absolute;top:8%;left:10%;
  display:flex;flex-direction:column;gap:6px;z-index:6;
}
.card .sigil-row .g{
  font-family:'Space Mono',ui-monospace,monospace;font-weight:700;font-size:22px;line-height:1;color:var(--cyan);
  text-shadow:-2.4px 0 var(--crt-red), 2.4px 0 var(--crt-cyan), 0 0 8px rgba(0,234,255,.5);
}
.card .sigil-row .g:nth-child(2){color:var(--magenta);font-size:18px;text-shadow:-2.2px 0 var(--crt-red), 2.2px 0 var(--crt-cyan)}
.card .sigil-row .g:nth-child(3){color:var(--amber);font-size:16px;opacity:.95;text-shadow:-2px 0 var(--crt-red), 2px 0 var(--crt-cyan)}
/* Per-card color rotations for sigil glyphs — 6 variants */
.card .sigil-row.rot1 .g:nth-child(1){color:var(--magenta)} .card .sigil-row.rot1 .g:nth-child(2){color:var(--amber)} .card .sigil-row.rot1 .g:nth-child(3){color:var(--cyan)}
.card .sigil-row.rot2 .g:nth-child(1){color:var(--acid)}    .card .sigil-row.rot2 .g:nth-child(2){color:var(--cyan)}  .card .sigil-row.rot2 .g:nth-child(3){color:var(--magenta)}
.card .sigil-row.rot3 .g:nth-child(1){color:var(--amber)}   .card .sigil-row.rot3 .g:nth-child(2){color:var(--violet)} .card .sigil-row.rot3 .g:nth-child(3){color:var(--acid)}
.card .sigil-row.rot4 .g:nth-child(1){color:var(--violet)}  .card .sigil-row.rot4 .g:nth-child(2){color:var(--acid)}  .card .sigil-row.rot4 .g:nth-child(3){color:var(--hot)}
.card .sigil-row.rot5 .g:nth-child(1){color:var(--hot)}     .card .sigil-row.rot5 .g:nth-child(2){color:var(--cyan)}  .card .sigil-row.rot5 .g:nth-child(3){color:var(--amber)}

/* Extra margin blips & blobs — more instrument density */
.card .blip{
  position:absolute;z-index:7;pointer-events:none;
  font-family:'Space Mono',ui-monospace,monospace;font-weight:700;font-size:9px;
  color:var(--amber);letter-spacing:.14em;opacity:.85;
  text-shadow:-1.4px 0 var(--crt-red), 1.4px 0 var(--crt-cyan);
}
.card .blip.mag{color:var(--magenta);text-shadow:-1.4px 0 var(--crt-red), 1.4px 0 var(--crt-cyan)}
.card .blip.acid{color:var(--acid);text-shadow:-1.4px 0 var(--crt-red), 1.4px 0 var(--crt-cyan)}
.card .blip.cy{color:var(--cyan);text-shadow:-1.4px 0 var(--crt-red), 1.4px 0 var(--crt-cyan)}
.card .blip.pulse{animation:blip-pulse 2.4s ease-in-out infinite}
.card .blip.slowblink{animation:blink 3.2s steps(2) infinite}

.card .blob{
  position:absolute;z-index:7;pointer-events:none;
  width:8px;height:8px;border-radius:50%;
  background:radial-gradient(circle at 30% 30%, var(--cyan), transparent 70%);
  filter:blur(.4px);opacity:.8;
  animation:blob-breathe 3s ease-in-out infinite;
}
.card .blob.mag{background:radial-gradient(circle at 30% 30%, var(--magenta), transparent 70%)}
.card .blob.violet{background:radial-gradient(circle at 30% 30%, var(--violet), transparent 70%)}
.card .blob.acid{background:radial-gradient(circle at 30% 30%, var(--acid), transparent 70%)}
.card .blob.hot{background:radial-gradient(circle at 30% 30%, var(--hot), transparent 70%)}
.card .blob.amber{background:radial-gradient(circle at 30% 30%, var(--amber), transparent 70%)}

.card .tick{
  position:absolute;z-index:7;pointer-events:none;
  width:14px;height:1px;background:var(--cyan);opacity:.55;
  box-shadow:0 0 4px rgba(0,234,255,.6);
}
.card .tick.v{width:1px;height:14px}
.card .tick.mag{background:var(--magenta);box-shadow:0 0 4px rgba(255,43,214,.6)}

.card .cornermark{
  position:absolute;z-index:7;pointer-events:none;
  width:22px;height:22px;
  border-style:solid;border-color:var(--cyan);
  opacity:.55;
}
.card .cornermark.tl{top:6%;left:5%;border-width:1px 0 0 1px}
.card .cornermark.tr{top:6%;right:5%;border-width:1px 1px 0 0}
.card .cornermark.bl{bottom:14%;left:5%;border-width:0 0 1px 1px}
.card .cornermark.br{bottom:14%;right:5%;border-width:0 1px 1px 0}

.card .schematic-mark{
  position:absolute;z-index:6;pointer-events:none;
  width:32px;height:48px;background:url('/assets/marks/schematic.png') center/contain no-repeat;
  opacity:.35;
}
.card .starcross-mark{
  position:absolute;z-index:7;pointer-events:none;
  width:14px;height:14px;background:url('/assets/marks/starcross.png') center/contain no-repeat;
  opacity:.7;animation:blip-pulse 3.6s ease-in-out infinite;
}

/* Edge-midpoint SVG wireframe solids — CSS 3D rotation, no WebGL */
.card .three-corner{
  position:absolute;pointer-events:none;z-index:7;
  width:56px;height:56px;
  mix-blend-mode:screen;
  opacity:.9;
  transform-style:preserve-3d;
  perspective:220px;
}
.card .three-corner.tm{top:4.5%;left:50%;transform:translate3d(-50%,0,0)}
.card .three-corner.rm{top:48%;right:.2%;transform:translate3d(0,-50%,0)}
.card .three-corner.bm{bottom:10.5%;left:50%;transform:translate3d(-50%,0,0)}
.card .three-corner.lm{top:48%;left:.2%;transform:translate3d(0,-50%,0)}
.card .three-corner svg{width:100%;height:100%;display:block;transform-origin:center}
.card .three-corner.spin-y svg{animation:spin-y-3d 14s linear infinite}
.card .three-corner.spin-y-r svg{animation:spin-y-3d 18s linear infinite reverse}
.card .three-corner.spin-x svg{animation:spin-x-3d 16s linear infinite}
.card .three-corner.spin-x-r svg{animation:spin-x-3d 20s linear infinite reverse}
@keyframes spin-y-3d{
  0%{transform:rotateY(0deg) rotateZ(0deg)}
  50%{transform:rotateY(180deg) rotateZ(180deg)}
  100%{transform:rotateY(360deg) rotateZ(360deg)}
}
@keyframes spin-x-3d{
  0%{transform:rotateX(0deg) rotateY(0deg)}
  50%{transform:rotateX(180deg) rotateY(90deg)}
  100%{transform:rotateX(360deg) rotateY(0deg)}
}

@keyframes blip-pulse{
  0%,100%{opacity:.3;transform:scale(1)}
  50%{opacity:1;transform:scale(1.25)}
}
@keyframes blob-breathe{
  0%,100%{transform:scale(1);opacity:.55}
  50%{transform:scale(1.5);opacity:1}
}

/* 7. Holo shimmer */
.card .holo{
  position:absolute;inset:0;z-index:8;pointer-events:none;
  background:linear-gradient(115deg,
    transparent 30%, rgba(255,255,255,.06) 45%, rgba(0,234,255,.12) 50%,
    rgba(255,43,214,.10) 55%, transparent 70%);
  mix-blend-mode:screen;
  animation:holo-sweep 18s ease-in-out infinite;
}

/* card meta strip below the card */
.card-meta{
  margin-top:14px;padding-top:12px;
  border-top:1px solid rgba(154,223,255,.15);
}
.card-meta .n{
  font-family:'Orbitron',sans-serif;font-weight:700;font-size:13px;
  letter-spacing:.2em;color:var(--ink);margin-bottom:2px;
}
.card-meta .r{
  font-family:'JetBrains Mono',monospace;font-size:10px;letter-spacing:.15em;
  color:var(--phase-hue);opacity:.8;margin-bottom:6px;
}
.card-meta .kw{
  font-family:'JetBrains Mono',monospace;font-size:9.5px;letter-spacing:.12em;
  color:var(--beige);opacity:.75;
}

/* ==================================================================
 *  LIVE SPREAD
 * ================================================================== */
.draw-btn{
  font-family:'Orbitron',sans-serif;font-weight:700;letter-spacing:.24em;font-size:13px;
  color:var(--ink);background:transparent;
  border:1px solid var(--cyan);padding:14px 28px;cursor:pointer;
  margin-bottom:32px;
  transition:all .3s;position:relative;
  text-shadow:-1.2px 0 var(--crt-red), 1.2px 0 var(--crt-cyan);
  box-shadow:inset 0 0 12px rgba(0,234,255,.15), 0 0 20px rgba(0,234,255,.1);
}
.draw-btn:hover{
  background:rgba(0,234,255,.08);
  border-color:var(--magenta);
  box-shadow:inset 0 0 20px rgba(255,43,214,.2), 0 0 30px rgba(255,43,214,.25);
}
.spread{
  display:grid;grid-template-columns:repeat(3, 1fr);gap:24px;
  max-width:1100px;
}
.spread-slot{position:relative}
.spread-slot .role{
  font-family:'JetBrains Mono',monospace;font-size:10px;letter-spacing:.32em;
  color:var(--cyan);opacity:.75;margin-bottom:8px;text-align:center;
}
.spread-slot.empty{
  aspect-ratio:0.6065;
  border:1px dashed rgba(154,223,255,.2);border-radius:10px;
  display:grid;place-items:center;
  font-family:'JetBrains Mono',monospace;font-size:11px;letter-spacing:.24em;
  color:var(--beige);opacity:.4;
}
.spread-read{
  margin-top:32px;padding:24px 26px;max-width:1100px;
  border-left:2px solid var(--cyan);
  background:rgba(154,223,255,.04);
  font-family:'Exo 2',sans-serif;font-style:italic;font-weight:300;font-size:16px;
  color:var(--ink);line-height:1.7;display:none;
}
.spread-read.on{display:block}
.spread-read strong{
  font-family:'JetBrains Mono',monospace;font-style:normal;font-weight:500;
  color:var(--phase-hue,var(--cyan));letter-spacing:.14em;font-size:13px;
}
@media (max-width:800px){
  .spread{grid-template-columns:1fr}
}

/* ==================================================================
 *  MODAL — deep-view single card
 * ================================================================== */
.modal-back{
  position:fixed;inset:0;z-index:100;
  background:rgba(3,3,6,.86);backdrop-filter:blur(14px);
  display:none;align-items:center;justify-content:center;padding:40px;
  opacity:0;transition:opacity .4s;
}
.modal-back.open{display:flex;opacity:1}
.modal{
  max-width:1000px;width:100%;display:grid;grid-template-columns: minmax(280px, 440px) 1fr;
  gap:40px;align-items:center;
}
.modal .card-holder{width:100%}
.modal .card-holder .card{max-width:440px;margin:0 auto}
.modal .body{color:var(--ink);font-family:'JetBrains Mono',monospace}
.modal .body .eb{font-size:10px;letter-spacing:.4em;color:var(--phase-hue);opacity:.85;margin-bottom:12px}
.modal .body h2{
  font-family:'Orbitron',sans-serif;font-weight:900;font-size:32px;letter-spacing:.16em;
  color:var(--ink);margin-bottom:6px;
  text-shadow:-1.6px 0 var(--crt-red), 1.6px 0 var(--crt-cyan);
}
.modal .body .st{font-family:'Exo 2',sans-serif;font-style:italic;font-size:15px;color:var(--beige);margin-bottom:24px}
.modal .body .trans{
  font-family:'Exo 2',sans-serif;font-style:italic;font-weight:300;font-size:17px;
  color:var(--ink);line-height:1.6;padding:16px 18px;
  border-left:2px solid var(--phase-hue);background:rgba(154,223,255,.04);margin-bottom:24px;
}
.modal .body .grid2{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.modal .body h4{font-family:'JetBrains Mono',monospace;font-size:9px;letter-spacing:.32em;color:var(--phase-hue);margin-bottom:6px;opacity:.85}
.modal .body p.kw{font-size:12px;letter-spacing:.14em;color:var(--ink);line-height:1.8}
.modal .body .stack{display:flex;gap:10px;font-family:'JetBrains Mono',monospace;font-size:22px}
.modal .body .stack .g{color:var(--cyan);text-shadow:0 0 10px rgba(0,234,255,.5)}
.modal .body .stack .g:nth-child(2){color:var(--magenta)}
.modal .body .stack .g:nth-child(3){color:var(--acid)}
.modal .body .tel{
  margin-top:24px;padding:12px 14px;border:1px dashed rgba(154,223,255,.2);
  font-size:10px;letter-spacing:.16em;color:var(--beige);opacity:.75;line-height:1.7;
}
.modal-close{
  position:fixed;top:24px;right:32px;z-index:101;
  font-family:'JetBrains Mono',monospace;font-size:14px;letter-spacing:.24em;
  color:var(--ink);background:none;border:1px solid rgba(154,223,255,.3);
  padding:10px 16px;cursor:pointer;
}
.modal-close:hover{background:rgba(0,234,255,.1);border-color:var(--cyan)}

/* ==================================================================
 *  CLOSING / COLOPHON
 * ================================================================== */
.colophon{
  padding:60px 32px 100px;text-align:center;position:relative;z-index:3;
  border-top:1px solid rgba(154,223,255,.12);margin-top:60px;
}
.colophon .oct{
  width:60px;margin:0 auto 16px;color:var(--cyan);
  animation:slow-spin 60s linear infinite;
}
.colophon .creed{
  font-family:'Exo 2',sans-serif;font-style:italic;font-weight:300;font-size:15px;
  color:var(--beige);max-width:640px;margin:0 auto 12px;line-height:1.7;
}
.colophon .sig{
  font-family:'JetBrains Mono',monospace;font-size:10px;letter-spacing:.3em;
  color:var(--ink);opacity:.55;margin-top:16px;
}

/* ==================================================================
 *  ANIMATIONS
 * ================================================================== */
@keyframes breathe{
  0%,100%{opacity:.35;transform:scale(1)}
  50%{opacity:.65;transform:scale(1.06)}
}
@keyframes slow-spin{to{transform:rotate(360deg)}}
@keyframes spin-cw{to{transform:rotate(360deg)}}
@keyframes spin-ccw{to{transform:rotate(-360deg)}}
@keyframes sphere-drift{
  0%{transform:translate(0,0)}
  50%{transform:translate(-3%, 4%)}
  100%{transform:translate(3%, -2%)}
}
@keyframes edge-cycle{
  0%{border-color:#00eaff;box-shadow:inset 0 0 24px rgba(0,234,255,.15)}
  17%{border-color:#ff2bd6;box-shadow:inset 0 0 24px rgba(255,43,214,.15)}
  34%{border-color:#9d4bff;box-shadow:inset 0 0 24px rgba(157,75,255,.15)}
  50%{border-color:#39ff14;box-shadow:inset 0 0 24px rgba(57,255,20,.10)}
  67%{border-color:#ff10a0;box-shadow:inset 0 0 24px rgba(255,16,160,.15)}
  84%{border-color:#2b8bff;box-shadow:inset 0 0 24px rgba(43,139,255,.15)}
  100%{border-color:#00eaff;box-shadow:inset 0 0 24px rgba(0,234,255,.15)}
}
@keyframes barcode-slide{to{background-position:24px 0}}
@keyframes blink{50%{opacity:0}}
@keyframes jitter{
  0%,90%,100%{transform:translate(0,0)}
  20%{transform:translate(.6px,-.4px)}
  45%{transform:translate(-.5px,.3px)}
  70%{transform:translate(.3px,.5px)}
}
@keyframes holo-sweep{
  0%,100%{transform:translateX(-30%)}
  50%{transform:translateX(30%)}
}

/* Reversed state */
.card.reversed{transform:rotate(180deg)}
.card.reversed .holo{filter:saturate(1.4) drop-shadow(0 0 6px var(--violet))}

/* ==================================================================
 *  RESPONSIVE
 * ================================================================== */
@media (max-width:800px){
  .modal{grid-template-columns:1fr;gap:24px}
  .modal .card-holder .card{max-width:320px}
  .modal .body h2{font-size:22px}
  .hero{padding-top:60px}
}

/* ============================================================
   PANTHEON EXTENSIONS — two-face flip + back dossier layout
   ============================================================ */

/* Flip container: card-cell holds .flip-wrap → .flip-inner (rotates on hover) */
.deck .card-cell { perspective: 1600px; }
.deck .flip-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 302 / 482;
  transform-style: preserve-3d;
}
.deck .flip-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 900ms cubic-bezier(.5,.1,.3,1);
  will-change: transform;
}
.deck .card-cell.flipped .flip-inner { transform: rotateY(180deg); }

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip-front { transform: rotateY(0deg); }
.flip-back  { transform: rotateY(180deg); }

/* Front card fills its face; existing .card styles carry through */
.flip-face > .card { width: 100%; height: 100%; }

/* Missing lineart art placeholder */
.aperture.art-missing::after {
  content: 'NO LINEART';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: .3em;
  color: var(--cyan); opacity: .4;
}

/* ================= BACK CARD =================
   dark plate · thin double-gold frame · god name banner ·
   rotating wireframe centerpiece · 2-column dossier · oracle · footer */
.back-card {
  position: relative;
  width: 100%; height: 100%;
  background:
    radial-gradient(120% 80% at 50% 20%, rgba(0,234,255,.06), transparent 60%),
    radial-gradient(90% 60% at 50% 100%, rgba(157,75,255,.05), transparent 55%),
    linear-gradient(180deg, #05070c 0%, #0a0e18 45%, #06090f 100%);
  color: var(--beige, #dfd2b4);
  overflow: hidden;
  border-radius: inherit;
  display: grid;
  grid-template-rows: auto auto 42% auto auto auto;
  padding: 12px 14px 10px;
  box-sizing: border-box;
}
.back-card .frame {
  position: absolute; inset: 0;
  pointer-events: none;
  border: 1px solid rgba(207,169,79,.35);
  outline: 1px solid rgba(207,169,79,.18);
  outline-offset: -6px;
  border-radius: inherit;
  z-index: 3;
}
.back-card .edge {
  position: absolute; inset: 2px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(0,234,255,.18), inset 0 0 40px rgba(0,234,255,.06);
  z-index: 4;
}

.back-register {
  display: flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px; letter-spacing: .28em;
  color: var(--cyan);
  padding: 4px 6px 3px;
  border-bottom: 1px solid rgba(0,234,255,.15);
  z-index: 5;
}
.back-register .arc { color: #cfa94f; font-weight: 700; }
.back-register .bar {
  flex: 0 0 22%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,234,255,.6), transparent);
}
.back-register .dossier-label { flex: 1; text-align: center; color: #cfa94f; opacity: .8; }
.back-register .blip { color: var(--cyan); }

.back-title {
  text-align: center;
  padding: 6px 0 4px;
  z-index: 5;
}
.back-god-name {
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-size: 22px;
  letter-spacing: .18em;
  color: #e6c675;
  text-shadow: 0 1px 0 #000, 0 0 12px rgba(207,169,79,.35);
}
.back-god-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  letter-spacing: .3em;
  color: var(--cyan);
  opacity: .7;
  margin-top: 4px;
  text-transform: uppercase;
}

.back-wireframe {
  position: relative;
  align-self: center;
  justify-self: center;
  width: 88%;
  height: 100%;
  margin: 2px 0;
  color: var(--cyan);
  z-index: 5;
}
.back-wireframe .wf-mount {
  position: absolute; inset: 0;
  border: 1px dashed rgba(0,234,255,.12);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(0,234,255,.05), transparent 65%);
}
.back-wireframe .wf-mount::before {
  content: '';
  position: absolute; inset: -6px;
  border: 1px solid rgba(207,169,79,.15);
  border-radius: 50%;
  pointer-events: none;
}
.back-wireframe .wf-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--cyan);
  opacity: .55;
}
.back-wireframe .wf-fallback svg {
  width: 100%; height: 100%;
  animation: wf-slow-spin 30s linear infinite;
}
.back-wireframe .wf-note {
  position: absolute;
  bottom: -12px; left: 0; right: 0;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 7.5px;
  letter-spacing: .35em;
  color: #cfa94f;
  opacity: .55;
}
@keyframes wf-slow-spin { to { transform: rotate(360deg); } }

.back-dossier {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  padding: 6px 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 7.5px;
  line-height: 1.5;
  letter-spacing: .05em;
  z-index: 5;
}
.dossier-col { display: flex; flex-direction: column; gap: 3px; }
.drow {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 6px;
  align-items: baseline;
}
.dlbl {
  color: #cfa94f;
  letter-spacing: .22em;
  font-size: 6.5px;
  opacity: .85;
}
.dval {
  color: var(--beige);
  opacity: .95;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-oracle {
  margin: 4px 6px 6px;
  padding: 6px 8px;
  border-left: 2px solid var(--cyan);
  background: linear-gradient(90deg, rgba(0,234,255,.04), transparent);
  z-index: 5;
}
.back-oracle-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 7px;
  letter-spacing: .35em;
  color: var(--cyan);
  margin-bottom: 4px;
}
.back-oracle p {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: 11px;
  line-height: 1.35;
  color: #dfd2b4;
  font-style: italic;
  margin: 0;
}

.back-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px 2px;
  border-top: 1px solid rgba(207,169,79,.2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  letter-spacing: .25em;
  color: #cfa94f;
  opacity: .75;
  z-index: 5;
}
.back-footer span:first-child { color: var(--cyan); font-size: 12px; letter-spacing: .3em; opacity: .85; }

/* Tighter deck responsive */
@media (max-width: 900px){
  .back-god-name { font-size: 18px; }
  .back-oracle p { font-size: 10px; }
  .back-dossier { font-size: 7px; }
  .dlbl { font-size: 6px; }
}

/* ==========================================================================
   BACK CARD — v4 two-column layout, matching front-page typography
   Design principles:
   - Uses ONLY Orbitron / JetBrains Mono / Space Mono / Exo 2 / VT323 (front-page stack)
   - Left column (18% wide): identity block, genealogy
   - Right column (18% wide): cosmic classification, sacred correspondences
   - Center 64% remains clear for the god wireframe
   - Bottom strip: oracle + telemetry (no giant central sigil card)
   - Card is 326x520 — everything sized for that box
   - Animations: only breathing wireframe glow + subtle register blip pulse
   ========================================================================== */

.back-pdf {
  position: relative;
  color: #eaf6ff;
  background:
    radial-gradient(120% 90% at 50% 100%, rgba(0,80,120,0.28) 0%, transparent 60%),
    radial-gradient(90% 70% at 50% 0%, rgba(0,60,120,0.22) 0%, transparent 60%),
    linear-gradient(180deg, #041018 0%, #020a12 50%, #01060c 100%);
  overflow: hidden;
  isolation: isolate;
  font-family: 'JetBrains Mono', monospace;
}

/* Faint horizontal scanlines — same subtle rhythm as before */
.back-pdf::after{
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg,
      transparent 0, transparent 22px,
      rgba(0,234,255,0.025) 22px, rgba(0,234,255,0.025) 23px);
  pointer-events: none;
  z-index: 6;
  mix-blend-mode: screen;
}

/* Wireframe god — central band, enlarged 1.57× (170×315) to fit above text panels */
.back-pdf .back-wireframe-fill{
  position: absolute;
  left: 50%; top: 116px;
  transform: translateX(-50%);
  width: 170px; height: 315px;
  z-index: 1;
  opacity: 1;
  /* Very subtle hue wash — the outline stays white for all gods, only a soft aura in phase color */
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.35));
  mix-blend-mode: normal;
  pointer-events: none;
  animation: wfBreathe 6s ease-in-out infinite;
}
@keyframes wfBreathe{
  0%,100%{ filter: drop-shadow(0 0 3px rgba(255,255,255,0.35)) drop-shadow(0 0 6px var(--phase-hue-soft, rgba(0,234,255,0.12))); }
  50%    { filter: drop-shadow(0 0 5px rgba(255,255,255,0.5)) drop-shadow(0 0 10px var(--phase-hue-soft, rgba(0,234,255,0.2))); }
}
.back-pdf .back-wireframe-fill .wf-mount,
.back-pdf .back-wireframe-fill canvas{
  position:absolute; inset:0; width:100%!important; height:100%!important;
}
.back-pdf .back-wireframe-fill .wf-fallback{
  position:absolute; inset:0; display:grid; place-items:center;
  color: var(--phase-hue, rgba(0,234,255,0.5));
}
.back-pdf .back-wireframe-fill .wf-fallback svg{
  width: 100%;
  height: 100%;
  animation: mandalaSpin 60s linear infinite;
  transform-origin: 50% 50%;
}
@keyframes mandalaSpin{
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Text layers above wireframe */
.back-pdf > *:not(.back-wireframe-fill):not(.frame):not(.edge){
  position: absolute;
  z-index: 3;
}
.back-pdf .frame{ z-index: 2; }
.back-pdf .edge{ z-index: 5; pointer-events: none; }

/* --------------------------------------------------------------------------
   1. TOP REGISTER — same rhythm as front's register bar
   -------------------------------------------------------------------------- */
.pdf-register{
  top: 12px; left: 16px; right: 16px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 8px;
  letter-spacing: 0.18em;
  color: rgba(154,223,255,0.85);
  text-transform: uppercase;
}
.pdf-arc{ color: var(--phase-hue, #00eaff); }
.pdf-sector{ color: rgba(255,255,255,0.6); white-space:nowrap; }
.pdf-bar{
  height: 1px;
  background: linear-gradient(90deg, rgba(154,223,255,0.5), rgba(154,223,255,0.05));
}
.pdf-blip{
  color: var(--phase-hue, #00eaff);
  font-size: 7px;
  line-height: 1;
  animation: blipDot 2.2s ease-in-out infinite;
}
@keyframes blipDot{
  0%,80%,100%{ opacity: 1; text-shadow: 0 0 3px currentColor; }
  40%       { opacity: 0.35; text-shadow: 0 0 6px currentColor; }
}

/* --------------------------------------------------------------------------
   2. IDENTITY BANNER — top center, name + roman on one row
   -------------------------------------------------------------------------- */
.pdf-tl{
  top: 30px;
  left: 16px; right: 16px;
  text-align: center;
}
.pdf-roman{
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.95);
  line-height: 1;
  display: inline-block;
  padding-right: 12px;
  margin-right: 12px;
  border-right: 1px solid rgba(214,242,255,0.45);
  vertical-align: middle;
  text-shadow: 0 0 4px rgba(255,255,255,0.35);
}
.pdf-name{
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.28em;
  color: #ffffff;
  display: inline-block;
  vertical-align: middle;
  text-shadow: 0 0 6px var(--phase-hue, #00eaff), 0 0 2px rgba(255,255,255,0.8);
}
.pdf-sub{
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  font-size: 8px;
  letter-spacing: 0.24em;
  color: rgba(214,242,255,0.85);
  margin-top: 5px;
  text-transform: uppercase;
}
.pdf-oneline{ display: none; } /* Kill the italic quote up top — reserved for oracle */

/* --------------------------------------------------------------------------
   3. COSMIC CLASSIFICATION — hide top-right stack, moved into right rail
   -------------------------------------------------------------------------- */
.pdf-tr{ display: none; }

/* --------------------------------------------------------------------------
   4. LEFT COLUMN — genealogy block
   -------------------------------------------------------------------------- */
.pdf-col-left{
  top: 172px;
  left: 12px;
  width: 100px;
  z-index: 4;
  text-align: left;
}
.pdf-col-right{
  top: 172px;
  right: 12px;
  width: 100px;
  z-index: 4;
  /* Keep text left-aligned so labels & values read left→right on both sides */
  text-align: left;
}

/* --------------------------------------------------------------------------
   COLLECTOR-CARD ADDITIONS (v8) — epithet ribbon, stat bar, myth panel, flavor moral
   -------------------------------------------------------------------------- */

/* Epithet ribbon — poetic title below the name */
.back-collector .pdf-epithet{
  top: 88px; left: 50%; transform: translateX(-50%);
  max-width: 70%;
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 7.5px;
  line-height: 1.25;
  letter-spacing: 0.32em;
  color: rgba(214,242,255,0.9);
  text-transform: uppercase;
  padding: 3px 12px;
  border-top: 1px solid rgba(214,242,255,0.28);
  border-bottom: 1px solid rgba(214,242,255,0.28);
  background: linear-gradient(90deg, rgba(2,8,14,0) 0%, rgba(2,8,14,0.65) 40%, rgba(2,8,14,0.65) 60%, rgba(2,8,14,0) 100%);
  text-shadow: 0 0 6px var(--phase-hue, #00eaff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 6;
}
.back-collector .pdf-epithet:empty{ display: none; }

/* Nudge sigil trigram below epithet */
.back-collector .pdf-sigil-ring{
  top: 118px;
}

/* Stat bar — MTG-style horizontal strip under the sigils */
.back-collector .pdf-statbar{
  top: 138px;
  left: 16px; right: 16px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  background: linear-gradient(90deg, rgba(2,8,14,0.85), rgba(2,8,14,0.65));
  border-top: 1px solid rgba(214,242,255,0.22);
  border-bottom: 1px solid rgba(214,242,255,0.22);
  z-index: 6;
  font-family: 'Space Mono', monospace;
}
.back-collector .pdf-statbar .stat{
  display: flex; align-items: center; gap: 5px;
  font-size: 7.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.back-collector .pdf-statbar .stat-lbl{
  color: rgba(214,242,255,0.6);
  font-weight: 700;
}
.back-collector .pdf-statbar .stat-val{
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-shadow: 0 0 5px var(--phase-hue, #00eaff);
}
.back-collector .pdf-statbar .stat-pips{
  display: inline-flex; gap: 3px; align-items: center;
}
.back-collector .pdf-statbar .pip{
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(214,242,255,0.45);
  box-sizing: border-box;
}
.back-collector .pdf-statbar .pip.on{
  background: var(--phase-hue, #00eaff);
  border-color: var(--phase-hue, #00eaff);
  box-shadow: 0 0 4px var(--phase-hue, #00eaff);
}
.back-collector .pdf-statbar .stat-elements{
  justify-content: flex-end;
  overflow: hidden;
}
.back-collector .pdf-statbar .chip-row{
  display: inline-flex; gap: 3px; flex-wrap: nowrap;
  overflow: hidden;
}
.back-collector .tag-chip{
  display: inline-block;
  padding: 2px 5px;
  font-family: 'Space Mono', monospace;
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #d6f2ff;
  background: rgba(2,8,14,0.75);
  border: 1px solid rgba(214,242,255,0.35);
  border-radius: 1px;
  white-space: nowrap;
}
.back-collector .tag-chip.dim{
  color: rgba(214,242,255,0.35);
  border-color: rgba(214,242,255,0.15);
}

/* Genesis / myth panel — MTG-style rules-text box, sits above the transmission */
.back-collector .pdf-myth{
  bottom: 100px;
  left: 18px; right: 18px;
  padding: 5px 10px 6px;
  background: rgba(2,8,14,0.86);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid rgba(214,242,255,0.32);
  border-radius: 1px;
  z-index: 5;
}
.back-collector .pdf-myth-hdr{
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 3px;
}
.back-collector .pdf-myth-badge{
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 6.5px;
  letter-spacing: 0.3em;
  color: var(--phase-hue, #00eaff);
  text-transform: uppercase;
  padding: 2px 5px;
  border: 1px solid rgba(214,242,255,0.4);
  border-radius: 1px;
  white-space: nowrap;
}
.back-collector .pdf-myth-title{
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 0 0 4px var(--phase-hue, #00eaff);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.back-collector .pdf-myth-body{
  font-family: 'Exo 2', sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 8.5px;
  line-height: 1.3;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}

/* Genesis body — same clamp; the full text is truncated to fit the 2-line panel */
.back-collector .pdf-genesis-body{
  -webkit-line-clamp: 2;
}

/* Oracle sits just above the barcode footer; myth panel above oracle */
.back-collector .pdf-oracle{
  bottom: 38px;
  left: 18px; right: 18px;  /* full-width now that QR is no longer at the corner */
}

/* Collector mode: push wireframe down below the stat bar (enlarged 170×315 to sit above myth panel) */
.back-collector.back-pdf .back-wireframe-fill{
  top: 158px;
  width: 170px; height: 315px;
}

/* (Zeus double-size override removed — Zeus now matches the rest of the deck) */

/* Flavor moral — italic quote line inside the myth panel (MTG designer-credit style) */
.back-collector .pdf-myth-flavor{
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(214,242,255,0.15);
  font-family: 'Exo 2', sans-serif;
  font-style: italic;
  font-weight: 300;
  font-size: 7.5px;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: rgba(214,242,255,0.62);
  text-align: right;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}

.pdf-col-left .pdf-lbl,
.pdf-col-right .pdf-lbl{
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 8px;
  letter-spacing: 0.28em;
  color: #d6f2ff;
  text-transform: uppercase;
  margin: 10px 0 5px;
  opacity: 1;
  text-shadow: 0 0 5px var(--phase-hue, #00eaff);
}
.pdf-col-left .pdf-lbl:first-child,
.pdf-col-right .pdf-lbl:first-child{
  margin-top: 0;
}

.pdf-col-left .pdf-row,
.pdf-col-right .pdf-row{
  display: flex; flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  /* Solid dark backdrop so any wireframe stroke that reaches this area is hidden */
  background: linear-gradient(90deg, rgba(2,8,14,0.88) 0%, rgba(2,8,14,0.78) 90%, rgba(2,8,14,0) 100%);
  padding: 4px 6px;
  border-radius: 2px;
  position: relative;
  z-index: 5;
}
.pdf-col-right .pdf-row{
  background: linear-gradient(-90deg, rgba(2,8,14,0.88) 0%, rgba(2,8,14,0.78) 90%, rgba(2,8,14,0) 100%);
}
.pdf-col-left .pdf-row span,
.pdf-col-right .pdf-row span{
  color: rgba(214,242,255,0.85);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-family: 'Space Mono', monospace;
  font-size: 7px;
  font-weight: 700;
}
.pdf-col-left .pdf-row b,
.pdf-col-right .pdf-row b{
  color: #ffffff;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-size: 8.5px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-break: break-word;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.5);
}

/* --------------------------------------------------------------------------
   5. SIGIL TRIGRAM — small, at top-center just under name
   -------------------------------------------------------------------------- */
.pdf-sigil-ring{
  top: 66px; left: 50%; transform: translateX(-50%);
  text-align: center;
  z-index: 4;
}
.pdf-sigil-lbl{ display: none; }
.pdf-sigil-glyphs{
  display: flex; gap: 10px; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  font-size: 13px;
  line-height: 1;
  color: var(--phase-hue, #00eaff);
  text-shadow: 0 0 5px currentColor;
}
.pdf-sigil-glyphs span{ display: inline-block; }

/* --------------------------------------------------------------------------
   6. BOTTOM DOSSIER GRID — hidden (data lives in side columns now)
   -------------------------------------------------------------------------- */
.pdf-dossier{ display: none; }
.pdf-left, .pdf-right, .pdf-bl, .pdf-br{ display: none !important; }

/* --------------------------------------------------------------------------
   7. ORACLE TRANSMISSION — one-liner strip at bottom, mono like front
   -------------------------------------------------------------------------- */
.pdf-oracle{
  bottom: 48px;
  left: 18px; right: 18px;  /* QR no longer occupies the corner — full width */
  padding: 8px 12px 9px;
  background: rgba(2,8,14,0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(214,242,255,0.28);
  border-radius: 1px;
  text-align: center;
}
.pdf-oracle-lbl{
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 7px;
  letter-spacing: 0.4em;
  color: #d6f2ff;
  margin-bottom: 5px;
  text-transform: uppercase;
  text-shadow: 0 0 5px var(--phase-hue, #00eaff);
}
.pdf-oracle p{
  margin: 0;
  font-family: 'Exo 2', sans-serif;
  font-style: italic;
  font-weight: 400;
  font-size: 11px;
  line-height: 1.4;
  color: #ffffff;
  letter-spacing: 0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0,0,0,0.95);
}
.pdf-oracle-q{ display: none; }

/* --------------------------------------------------------------------------
   8. BARCODE (subtle, VT323-style) + FOOTER
   -------------------------------------------------------------------------- */
.pdf-barcode{
  position: absolute;
  bottom: 26px; left: 16px; right: 16px;
  height: 6px;
  display: flex; gap: 1.2px;
  align-items: stretch;
  z-index: 3;
  pointer-events: none;
  opacity: 0.7;
}
.pdf-barcode i{
  display: block;
  height: 100%;
  background: rgba(154,223,255,0.7);
  border-radius: 0.5px;
  min-width: 1px;
}

.pdf-footer{
  bottom: 12px; left: 16px; right: 16px;
  padding: 4px 0 0;
  border-top: 1px solid rgba(154,223,255,0.14);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 6.5px;
  letter-spacing: 0.28em;
  color: rgba(154,223,255,0.7);
  text-transform: uppercase;
}
.pdf-glyphs{
  color: var(--phase-hue, #00eaff);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-shadow: 0 0 4px currentColor;
}
.pdf-mid{
  color: rgba(255,255,255,0.5);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 6.5px;
}
.pdf-omega{
  color: rgba(154,223,255,0.6);
  letter-spacing: 0.3em;
  font-size: 6.5px;
}



/* ==========================================================================
   QR CODE — bottom-left, disguised as an alchemical registry seal
   Sits in the empty corner below the left column, above the footer.
   Real & scannable but styled to match the cyan wire aesthetic.
   ========================================================================== */
.pdf-qr{
  /* CENTERED just above the myth title — no longer bottom-right corner */
  position: absolute;
  bottom: 175px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  width: 56px;
  height: 56px;
  z-index: 6;
  padding: 4px;
  background: rgba(2,8,14,0.65);
  border: 1px solid rgba(154,223,255,0.28);
  border-radius: 1px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.4),
    0 0 8px rgba(0,234,255,0.15);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
.pdf-qr:hover{
  border-color: var(--phase-hue, #00eaff);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.4),
    0 0 14px var(--phase-hue, rgba(0,234,255,0.55));
}
.pdf-qr-canvas{
  display: block;
  width: 100% !important;
  height: 100% !important;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  opacity: 0.9;
}
/* Corner brackets — occult registry seal styling. Positioned OUTSIDE the QR
   scan area so they don't cover data modules. */
.pdf-qr-corner{
  position: absolute;
  width: 5px; height: 5px;
  border: 1px solid var(--phase-hue, #00eaff);
  opacity: 0.85;
  pointer-events: none;
}
.pdf-qr-corner.tl{ top: -1px;   left: -1px;   border-right: none; border-bottom: none; }
.pdf-qr-corner.tr{ top: -1px;   right: -1px;  border-left:  none; border-bottom: none; }
.pdf-qr-corner.bl{ bottom: -1px;left: -1px;   border-right: none; border-top:    none; }
.pdf-qr-label{
  position: absolute;
  bottom: -10px;
  left: 0; right: 0;
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 5.5px;
  letter-spacing: 0.32em;
  color: var(--phase-hue, #00eaff);
  opacity: 0.7;
  text-transform: uppercase;
  pointer-events: none;
}

/* ==================================================================
 *  v9 — THE PLATE (2026-09-03)
 *  Front: one clipped "field" holds every animated layer + the god.
 *  Chamfered corners, semicircle notches top/bottom centre for the
 *  edge solids, margin stays void. Sizes in cqw so it scales with
 *  the card (grid cell, modal, spread all differ in width).
 * ================================================================== */
.card{ container-type:inline-size; }

.card .field{
  --plate-top:5.2%; --plate-bottom:11.2%; --plate-side:8%;
  position:absolute; top:var(--plate-top); left:var(--plate-side); right:var(--plate-side); bottom:var(--plate-bottom);
  z-index:2; overflow:hidden; isolation:isolate;
  /* clip-path is set per card by plate.js (chamfers + filleted notches) */
}
/* the aperture now fills the field instead of positioning against the card */
.card .field .aperture,
.card.painted .field .aperture{ top:0; left:0; right:0; bottom:0; clip-path:none; border-radius:0; }
/* keyed body always rides on top of the weather */
.card .field .aperture{ z-index:4; }
.card .field .vortex{ z-index:1; }
.card .field .sphere{ z-index:1; }
.card .field .orbits{ z-index:2; }
.card .field .spiro{  z-index:2; }
/* full-bleed painting under the weather; body cutout above it (green-mask rule) */
.card .field .art-under{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:0;
  opacity:.95; filter:saturate(.95) brightness(.92);
}
.card.painted.fullbleed .field .vortex{ mix-blend-mode:screen; opacity:calc(.07 * var(--card-vortex-op,1)); }
.card.painted.fullbleed .field .sphere{ mix-blend-mode:screen; opacity:calc(.16 * var(--card-sphere-op,1)); }
.card.painted.fullbleed .field .orbits{ mix-blend-mode:screen; opacity:calc(.24 * var(--card-orbit-op,1)); }
.card.painted.fullbleed .field .spiro{  mix-blend-mode:screen; opacity:calc(.22 * var(--card-spiro-op,1)); }
/* never vignette-mask a keyed body (old fullbleed rule) */
.card.painted.cutout .field .aperture img.art{ -webkit-mask-image:none; mask-image:none; }
/* The body: whole figure visible, gently oversized so feet/plinth reach the
   plate floor. `position:absolute; inset:0` MATCHES img.art-glow exactly — the
   glow is a blurred twin of this same file and must occupy the identical box.
   Left in normal flow the two resolve their containing block differently once
   the aperture has any padding/border, so the outline drifts off the body. Keep
   these two rules byte-identical in geometry: fit, position, transform, origin. */
.card.painted.cutout .field .aperture img.art{
  position:absolute; inset:0;
  width:100%; height:100%; object-fit:contain; object-position:50% 92%;
  transform:scale(1.04); transform-origin:50% 92%;
}

/* corner L-brackets are redundant once the plate corners are chamfered */
.card .cornermark{ display:none; }

/* edge solids sit INSIDE their notches, on void */
.card .three-corner{ width:18cqw; height:18cqw; }
.card .three-corner.tm{ top:calc(5.2% + 3.5cqw - 9cqw); }
.card .three-corner.bm{ top:calc(88.8% - 3.5cqw - 9cqw); bottom:auto; }
/* barcode strip: leave the bottom notch clear */
.card .barcode2{
  top:83.5%;
  -webkit-mask-image:linear-gradient(90deg,#000 0 32%,transparent 32% 68%,#000 68%);
          mask-image:linear-gradient(90deg,#000 0 32%,transparent 32% 68%,#000 68%);
}

/* ==================================================================
 *  v9 — CARD BACK (2026-09-03)
 *  Vertical bands, no boxes. Everything lives inside the frame's
 *  inner margin (9cqw). Wireframe gets its own band; dossier sits
 *  below it; Root Permission replaces the Transmission panel.
 * ================================================================== */
.back-v9{ --m:9cqw; }
.back-v9 .pdf-register{ top:2.6%; left:var(--m); right:var(--m); font-size:7.5px; grid-template-columns:auto 1fr auto 1fr auto auto; white-space:nowrap; }

.back-v9 .pdf-tl{ top:7%; left:var(--m); right:var(--m); text-align:center; }
.back-v9 .pdf-name{ display:block; font-size:16px; letter-spacing:.3em; }
.back-v9 .pdf-sub{
  display:flex; align-items:baseline; justify-content:center; gap:10px;
  margin-top:6px; font-size:8px; letter-spacing:.26em;
}
.back-v9 .pdf-roman{
  font-family:'Space Mono', monospace; font-weight:700; font-size:13px; letter-spacing:.1em;
  color:#fff; text-shadow:0 0 6px var(--phase-hue,#00eaff);
  padding:0; margin:0; border:0; line-height:1;
}
.back-v9 .pdf-sub-txt{ color:rgba(214,242,255,.85); }

.back-v9 .pdf-epithet{
  top:16.4%; left:var(--m); right:var(--m); max-width:none; transform:none;
  background:none; padding:4px 0; font-size:7px; letter-spacing:.3em;
  border-top:1px solid rgba(214,242,255,.22); border-bottom:1px solid rgba(214,242,255,.22);
}
.back-v9 .pdf-sigil-ring{ top:21.6%; }
.back-v9 .pdf-statbar{
  top:25.6%; left:var(--m); right:var(--m);
  background:none; padding:4px 0;
  border-top:1px solid rgba(214,242,255,.16); border-bottom:1px solid rgba(214,242,255,.16);
  gap:8px;
}
.back-v9 .pdf-statbar .chip-row{
  font-family:'Space Mono', monospace; font-weight:700; font-size:6.5px; letter-spacing:.18em;
  color:#d6f2ff; white-space:nowrap;
}

/* wireframe band */
.back-v9.back-pdf .back-wireframe-fill,
.back-collector.back-pdf.back-v9 .back-wireframe-fill{
  top:30.6%; left:50%; transform:translateX(-50%);
  width:72cqw; height:32.5%;
}

/* dossier: two unboxed columns */
.back-v9 .pdf-col-left,
.back-v9 .pdf-col-right{ top:64%; width:39cqw; }
/* the cast mirrors the scene: flush to the far right edge (Niko, 2026-09-15) */
.back-myth .pdf-col-right{ text-align:right; }
.back-myth .pdf-col-right .pdf-row{ align-items:flex-end; }
.back-v9 .pdf-col-left{ left:var(--m); }
.back-v9 .pdf-col-right{ right:var(--m); left:auto; }
.back-v9 .pdf-lbl{ margin:0 0 4px; font-size:7px; letter-spacing:.3em; }
.back-v9 .pdf-row{
  background:none; padding:0; margin-bottom:5px; gap:1px;
}
.back-v9 .pdf-row span{ font-size:6px; letter-spacing:.22em; color:rgba(214,242,255,.62); }
.back-v9 .pdf-row b{ font-size:8px; line-height:1.3; -webkit-line-clamp:2; }

/* root permission — the only prose on the back */
.back-v9 .pdf-root{
  top:82.6%; left:var(--m); width:63cqw;
  border-top:1px solid rgba(214,242,255,.22); padding-top:5px;
}
.back-v9 .pdf-root-eyebrow{
  font-family:'Space Mono', monospace; font-weight:700; font-size:6.5px; letter-spacing:.3em;
  text-transform:uppercase; color:var(--phase-hue,#00eaff); text-shadow:0 0 5px currentColor;
  margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.back-v9 .pdf-root-body{
  margin:0; font-family:'Exo 2', sans-serif; font-style:italic; font-weight:400;
  font-size:8.5px; line-height:1.35; color:#fff; letter-spacing:.01em;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  text-shadow:0 1px 3px rgba(0,0,0,.95);
}

/* QR: square, centred, clear of the frame */
.back-v9 .pdf-qr{
  top:82.6%; right:var(--m); left:auto; bottom:auto; transform:none;
  width:16cqw; height:16cqw; padding:0; box-sizing:border-box;
  display:grid; place-items:center;
  background:rgba(2,8,14,.55); border:1px solid rgba(154,223,255,.3);
  backdrop-filter:none; -webkit-backdrop-filter:none;
}
.back-v9 .pdf-qr-canvas{ width:82% !important; height:82% !important; image-rendering:auto; opacity:.95; }
.back-v9 .pdf-qr-label{ bottom:-9px; font-size:5px; }

.back-v9 .pdf-footer{ bottom:2.4%; left:13cqw; right:13cqw; }
/* retired panels */
.back-v9 .pdf-myth, .back-v9 .pdf-oracle, .back-v9 .pdf-myth-flavor{ display:none; }


/* ==================================================================
 *  v10 (2026-09-03 PM) — 3D solids, per-god weather, banner, back re-layout
 * ================================================================== */
/* solids: bigger, centred in the 12cqw notches, real 3D canvases */
.card .three-corner{ width:22cqw; height:22cqw; mix-blend-mode:normal; opacity:1; perspective:none; }
.card .three-corner canvas.solid3d{ width:100%; height:100%; display:block; filter:drop-shadow(0 0 6px var(--phase-hue,#00eaff)); }
.card .three-corner.tm{ top:calc(5.2% + 5cqw - 11cqw); }
.card .three-corner.bm{ top:calc(88.8% - 5cqw - 11cqw); bottom:auto; }
.card .three-corner.lm{ left:-3cqw; }
.card .three-corner.rm{ right:-3cqw; }
.card .barcode2{
  -webkit-mask-image:linear-gradient(90deg,#000 0 26%,transparent 26% 74%,#000 74%);
          mask-image:linear-gradient(90deg,#000 0 26%,transparent 26% 74%,#000 74%);
}

/* the spiral: exact god colour (sacred_colors) — PNG used as a mask over a colour fill */
.card .field .vortex{
  background:var(--god-hue, var(--phase-hue));
  -webkit-mask:url('/assets/geometry/vortex.png') center/contain no-repeat;
          mask:url('/assets/geometry/vortex.png') center/contain no-repeat;
  filter:none;
  opacity:calc(.17 * var(--card-vortex-op,1));
}
.card.painted.fullbleed .field .vortex{ opacity:calc(.16 * var(--card-vortex-op,1)); mix-blend-mode:screen; }
/* the far-back flower: per-god sigil vector, same colour, static */
.card .field .spiro{
  background:var(--god-hue, var(--phase-hue));
  -webkit-mask:var(--sigil) center/contain no-repeat;
          mask:var(--sigil) center/contain no-repeat;
  filter:none; animation:none; inset:10%;
  opacity:calc(.16 * var(--card-spiro-op,1));
  mix-blend-mode:screen;
}

/* front banner = the band from the back: hairlines, name + subtitle inside */
.card .banner{ top:87.9%; left:9cqw; right:9cqw; padding:0; background:none; border-radius:0; }
.card .banner .row{ margin:0 0 3px; font-size:7.5px; }
.card .banner .band{
  padding:3px 6px 3px;
  border-top:1px solid rgba(214,242,255,.32); border-bottom:1px solid rgba(214,242,255,.32);
  background:linear-gradient(90deg, rgba(2,8,14,0) 0%, rgba(2,8,14,.8) 30%, rgba(2,8,14,.8) 70%, rgba(2,8,14,0) 100%);
}
.card .banner .nm{ font-size:12px; letter-spacing:.24em; text-indent:.24em; line-height:1.1; animation:none; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.card .banner .sub{ font-size:6.5px; letter-spacing:.16em; text-indent:.16em; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; opacity:.85; }
.card .banner .glyphs[hidden]{ display:none; }
/* keep corner texts off the frame ornaments */
.card .footer{ left:12cqw; right:12cqw; bottom:1.1%; font-size:6.5px; }
.card .footer .m{ display:none; }

/* ---- back: head band +20% and centred; columns flank a centred QR; no epithet ---- */
.back-v9 .pdf-epithet{ display:none; }
.back-v9 .pdf-sigil-ring{ top:17.5%; }
.back-v9 .pdf-statbar{ top:22.4%; }
.back-v9.back-pdf .back-wireframe-fill,
.back-collector.back-pdf.back-v9 .back-wireframe-fill{
  top:27.5%; left:50%; transform:translateX(-50%);
  width:82cqw; height:39%;
}
.back-v9 .pdf-col-left,
.back-v9 .pdf-col-right{ top:67.5%; width:30cqw; }
.back-v9 .pdf-col-left{ left:var(--m); }
.back-v9 .pdf-col-right{ right:var(--m); left:auto; }
.back-v9 .pdf-row b{ -webkit-line-clamp:2; font-size:7px; line-height:1.25; }
.back-v9 .pdf-row{ margin-bottom:4px; }
.back-v9 .pdf-qr{
  top:67.5%; left:50%; right:auto; transform:translateX(-50%);
  width:17cqw; height:17cqw;
}
.back-v9 .pdf-qr-label{ bottom:-9px; }
.back-v9 .pdf-root{ top:85.4%; left:var(--m); right:var(--m); width:auto; }
.back-v9 .pdf-root-body{ -webkit-line-clamp:2; font-size:8px; }

/* ==================================================================
 *  v11 (2026-09-03 eve) — smaller solids, colour breath, side icons,
 *  god glow; back: columns flank the head, blurb, centred QR
 * ================================================================== */
.card .three-corner.tm{ width:13cqw; height:13cqw; top:calc(5.2% + 5cqw - 6.5cqw); }
.card .three-corner.bm{ width:9cqw;  height:9cqw;  top:calc(88.8% - 5cqw - 4.5cqw); }
/* 2D diagram icons in the side margins, one each side, off the vertical centre */
.card .side-icon{
  position:absolute; z-index:7; pointer-events:none;
  width:8cqw; height:8cqw; background:var(--god-hue, var(--phase-hue));
  -webkit-mask:var(--icon) center/contain no-repeat; mask:var(--icon) center/contain no-repeat;
  opacity:.9; filter:drop-shadow(0 0 4px var(--god-hue, var(--phase-hue)));
}
/* LEFT rail: electric magenta, nudged in off the edge, and lifted into the top-left
   margin corner so it reads as a corner mark rather than a floating glyph. */
.card .side-icon.l{
  left:2.4cqw; top:9.5%;
  background:#ff2fd0;
  filter:drop-shadow(0 0 5px #ff2fd0) drop-shadow(0 0 12px rgba(255,47,208,.55));
  opacity:.95;
}
/* RIGHT rail: TRUE KNOCKOUT (Niko 2026-09-08 — "cutting an actual hole to the card base").
   The glyph is not drawn; it is punched out of everything above the card's base
   gradient, so what you see inside the shape IS the card ground — the flat-art
   equivalent of the notches that reveal the base behind the 3D solids.

   How: the icon element is filled with the card's own base gradient and sits above
   the art at z-index 7, masked to the glyph. Because the fill is the base colour and
   the mask is the glyph, the result reads as a hole rather than a painted shape.
   A hairline rim keeps the cut legible where the art behind it is already dark. */
.card .side-icon.r{
  right:.6cqw; top:56%;
  mix-blend-mode:normal;
  background:
    linear-gradient(168deg, #0a0e14, #100a16 55%, #140912);
  opacity:1;
  filter:
    drop-shadow(0 0 1px rgba(255,255,255,.55))
    drop-shadow(0 0 7px var(--god-hue, var(--phase-hue)))
    drop-shadow(0 0 18px var(--god-hue, var(--phase-hue)));
}
/* god glow: quiet by default, blooms on hover */
.card.painted.cutout .field .aperture img.art{
  filter:
    drop-shadow(-1px 0 rgba(255,0,90,.3)) drop-shadow(1px 0 rgba(0,220,255,.3))
    drop-shadow(0 0 10px var(--god-hue, rgba(0,234,255,.5)))
    drop-shadow(0 6px 14px rgba(0,0,0,.55));
  transition:filter .6s ease;
  animation:god-breathe 6s ease-in-out infinite;
}
.card.painted.cutout:hover .field .aperture img.art{
  filter:
    drop-shadow(-1px 0 rgba(255,0,90,.3)) drop-shadow(1px 0 rgba(0,220,255,.3))
    drop-shadow(0 0 18px var(--god-hue, rgba(0,234,255,.7)))
    drop-shadow(0 0 40px var(--god-hue, rgba(0,234,255,.35)))
    drop-shadow(0 6px 14px rgba(0,0,0,.55));
  animation:none;
}
@keyframes god-breathe{ 0%,100%{ opacity:1 } 50%{ opacity:.93 } }

/* ---- back v11 ---- */
.back-v9.back-pdf .back-wireframe-fill,
.back-collector.back-pdf.back-v9 .back-wireframe-fill{
  top:31.5%; left:50%; transform:translateX(-50%);
  width:52cqw; height:31%;
}
.back-v9 .pdf-col-left,
.back-v9 .pdf-col-right{ top:33%; width:23cqw; }
.back-v9 .pdf-col-left{ left:var(--m); }
.back-v9 .pdf-col-right{ right:var(--m); left:auto; }
.back-v9 .pdf-row b{ font-size:6.8px; -webkit-line-clamp:3; }
.back-v9 .pdf-blurb{
  top:64%; left:var(--m); right:var(--m);
  font-family:'Exo 2', sans-serif; font-style:italic; font-weight:400; font-size:7.6px; line-height:1.35;
  color:rgba(236,246,255,.94); text-align:center; letter-spacing:.01em;
  display:-webkit-box; -webkit-line-clamp:5; -webkit-box-orient:vertical; overflow:hidden;
  text-shadow:0 1px 3px rgba(0,0,0,.95);
  border-top:1px solid rgba(214,242,255,.18); padding-top:5px;
}
.back-v9 .pdf-root{ top:79.5%; left:var(--m); right:auto; width:60cqw; }
.back-v9 .pdf-root-body{ -webkit-line-clamp:2; font-size:7.6px; }
.back-v9 .pdf-qr{ top:79.5%; left:auto; right:var(--m); transform:none; width:16cqw; height:16cqw; }
.back-v9 .pdf-qr-canvas{ position:absolute; left:9%; top:9%; width:82% !important; height:82% !important; }
.back-v9 .pdf-qr-label{ bottom:-8px; }
/* footer clear of the corner scrolls */
.back-v9 .pdf-footer{ bottom:2.2%; left:20cqw; right:20cqw; grid-template-columns:1fr; text-align:center; }
.back-v9 .pdf-footer .pdf-glyphs, .back-v9 .pdf-footer .pdf-omega{ display:none; }

/* ==================================================================
 *  v12 — constellation background, ribbon-less back, QR/column tune
 * ================================================================== */
.card .field > canvas.constellation, .card.back-card > canvas.constellation{
  position:absolute; inset:-4%; width:108%; height:108%; z-index:0; pointer-events:none;
  opacity:.55; filter:blur(.2px);
  transform:translate(var(--tilt-x,0px), var(--tilt-y,0px)); transition:transform .35s ease-out;
}
.back-pdf > canvas.constellation{ z-index:0 !important; opacity:.4; }
/* top solid another 10% smaller */
.card .three-corner.tm{ width:11.7cqw; height:11.7cqw; top:calc(5.2% + 5cqw - 5.85cqw); }
/* hecate: tall figure was clipped by the top notch — 15% smaller, feet on the floor */
.card[data-slug="hecate"] .field .aperture img.art{ transform:scale(.88); transform-origin:50% 100%; object-position:50% 100%; }

/* back: remove the bottom ribbon from the frame art (keeps corners + outer border) */
.back-v9 .frame{
  -webkit-mask:
    linear-gradient(#000,#000) top / 100% 89.6% no-repeat,
    linear-gradient(#000,#000) bottom / 100% 1.8% no-repeat,
    linear-gradient(#000,#000) left / 9.5% 100% no-repeat,
    linear-gradient(#000,#000) right / 9.5% 100% no-repeat;
  mask:
    linear-gradient(#000,#000) top / 100% 89.6% no-repeat,
    linear-gradient(#000,#000) bottom / 100% 1.8% no-repeat,
    linear-gradient(#000,#000) left / 9.5% 100% no-repeat,
    linear-gradient(#000,#000) right / 9.5% 100% no-repeat;
}
.back-v9 .pdf-col-left,
.back-v9 .pdf-col-right{ top:38.5%; }
.back-v9 .pdf-qr{ width:19cqw; height:19cqw; top:78.5%; }
.back-v9 .pdf-qr-canvas{ left:7%; top:7%; width:86% !important; height:86% !important; }
.back-v9 .pdf-root{ top:79.5%; width:58cqw; }
.back-v9 .pdf-footer{ bottom:3.2%; }
/* stat strip: one baseline, ELEM value never wraps */
.back-v9 .pdf-statbar{ align-items:baseline; grid-template-columns:auto auto 1fr; }
.back-v9 .pdf-statbar .stat{ align-items:baseline; }
.back-v9 .pdf-statbar .stat-elements{ justify-content:flex-end; overflow:visible; white-space:nowrap; }
.back-v9 .pdf-statbar .chip-row{ display:inline; white-space:nowrap; }


/* ==================================================================
 *  v13 — per-god fit, flower counter-rotation, ACTIVATION (hover / reading)
 * ================================================================== */
.card[data-slug="hermes"] .field .aperture img.art{ transform:scale(1.14) translateY(-3.5%); transform-origin:50% 92%; }
.card[data-slug="prometheus"] .field .aperture img.art{ transform:scale(.88); transform-origin:50% 100%; object-position:50% 100%; }

/* the flower: slow counter-clockwise drift, contrasting colour (god hue pulled toward the phase hue) */
.card .field .spiro{
  background:color-mix(in oklch, var(--god-hue, var(--phase-hue)) 45%, var(--phase-hue) 55%);
  animation:spin-ccw calc(var(--card-vortex-dur, 96s) * 1.8) linear infinite;
  opacity:calc(.24 * var(--card-spiro-op,1));
}

/* aura twin: hidden until activation */
.card .field .aperture img.art-glow{
  position:absolute; inset:0; width:100%; height:100%; object-fit:contain; object-position:50% 92%;
  transform:scale(1.04); transform-origin:50% 92%; opacity:0; pointer-events:none; z-index:-1;
  filter:blur(16px) saturate(3) brightness(1.6); mix-blend-mode:screen;
  transition:opacity .5s ease;
}
.card[data-slug="hermes"] .field .aperture img.art-glow{ transform:scale(1.14) translateY(-3.5%); }
.card[data-slug="prometheus"] .field .aperture img.art-glow,
.card[data-slug="hecate"] .field .aperture img.art-glow{ transform:scale(.88); transform-origin:50% 100%; object-position:50% 100%; }

/* ---------- ACTIVATION ---------- */
/* PALETTE LAW: cycle the electric tokens (as act-edge does) instead of
   hue-rotate, which sweeps the whole wheel and lands on off-spec colours. */
@keyframes act-hue    { 0%,100%{ filter:drop-shadow(0 0 6px var(--cyan))    brightness(1.3) }
                        25%    { filter:drop-shadow(0 0 8px var(--magenta)) brightness(1.4) }
                        50%    { filter:drop-shadow(0 0 7px var(--acid))    brightness(1.35) }
                        75%    { filter:drop-shadow(0 0 8px var(--amber))   brightness(1.4) } }
@keyframes act-flicker{ 0%,100%{opacity:1} 8%{opacity:.55} 12%{opacity:1} 40%{opacity:.8} 43%{opacity:1} 71%{opacity:.6} 74%{opacity:1} }
@keyframes act-edge   { 0%{border-color:#00eaff; box-shadow:0 0 22px #00eaff, inset 0 0 34px rgba(0,234,255,.35)}
                        25%{border-color:#ff2bd6; box-shadow:0 0 30px #ff2bd6, inset 0 0 40px rgba(255,43,214,.35)}
                        50%{border-color:#39ff14; box-shadow:0 0 26px #39ff14, inset 0 0 36px rgba(57,255,20,.3)}
                        75%{border-color:#ff9a3c; box-shadow:0 0 30px #ff9a3c, inset 0 0 40px rgba(255,154,60,.35)}
                        100%{border-color:#00eaff; box-shadow:0 0 22px #00eaff, inset 0 0 34px rgba(0,234,255,.35)} }
@keyframes act-laser  { from{ background-position:0 -120% } to{ background-position:0 220% } }
@keyframes act-aura   { 0%,100%{ opacity:.55; transform:scale(1.04) } 50%{ opacity:.95; transform:scale(1.08) } }
@keyframes act-text   { 0%,100%{ text-shadow:-2px 0 #ff2bd6, 2px 0 #00eaff, 0 0 8px #fff } 50%{ text-shadow:-3px 0 #39ff14, 3px 0 #ff9a3c, 0 0 14px #fff } }

.card.activated{ transform:translateY(-6px) scale(1.015); transition:transform .35s ease; }
.card.activated .frame{ animation:act-hue 2.6s linear infinite, act-flicker 1.1s steps(1) infinite; filter:brightness(1.35) drop-shadow(0 0 5px var(--phase-hue)); opacity:1; }
.card.activated .edge{ animation:act-edge 1.6s linear infinite; }
.card.activated .field .vortex{ animation-duration:9s; opacity:calc(.42 * var(--card-vortex-op,1)); animation-name:spin-cw; }
.card.activated .field .vortex::after{ content:none; }
.card.activated .field .spiro{ animation-duration:14s; opacity:.55; }
.card.activated .field .sphere, .card.activated .field .orbits{ animation-duration:6s; opacity:.6; filter:saturate(2) brightness(1.4); }
.card.activated .field .aperture img.art-glow{ opacity:.8; animation:act-aura 1.4s ease-in-out infinite, act-hue 3s linear infinite; }
.card.activated .field .aperture img.art{
  filter:drop-shadow(0 0 3px #fff) drop-shadow(0 0 16px var(--god-hue)) drop-shadow(0 0 34px var(--phase-hue)) contrast(1.12) saturate(1.2);
  animation:none;
}
/* laser sweep across the plate */
.card .field::after{
  content:""; position:absolute; inset:0; z-index:6; pointer-events:none; opacity:0;
  background:linear-gradient(180deg, transparent 0 44%, rgba(255,255,255,.25) 49%, var(--god-hue, #00eaff) 50.5%, rgba(255,255,255,.2) 52%, transparent 57%) 0 0 / 100% 300% no-repeat;
  mix-blend-mode:screen;
}
.card.activated .field::after{ opacity:.9; animation:act-laser 1.3s linear infinite; }
/* instruments flicker through their colours */
.card.activated .register, .card.activated .telemetry, .card.activated .rail, .card.activated .banner, .card.activated .footer,
.card.activated .sigil-row, .card.activated .blip, .card.activated .tick, .card.activated .barcode2{
  animation:act-text .5s steps(2) infinite, act-flicker .9s steps(1) infinite;
}
.card.activated .mark, .card.activated .side-icon, .card.activated .blob{ animation:act-hue 1.2s linear infinite; opacity:1; filter:brightness(1.6) drop-shadow(0 0 6px currentColor); }
.card.activated .three-corner canvas.solid3d{ filter:drop-shadow(0 0 10px #fff) drop-shadow(0 0 18px var(--phase-hue)); }
.card.activated .holo{ animation-duration:1.4s; opacity:1; }
.card.activated > canvas.constellation, .card.activated .field > canvas.constellation{ opacity:1; }
/* back-side activation */
.card.back-card.activated{ animation:act-flicker 1.3s steps(1) infinite; }
.card.back-card.activated .back-wireframe-fill{ filter:drop-shadow(0 0 8px #fff) drop-shadow(0 0 22px var(--phase-hue)); animation:act-hue 2.2s linear infinite; }
.card.back-card.activated .pdf-name, .card.back-card.activated .pdf-roman, .card.back-card.activated .pdf-lbl, .card.back-card.activated .pdf-root-eyebrow{ animation:act-text .5s steps(2) infinite; }
.card.back-card.activated .pdf-qr{ box-shadow:0 0 18px var(--phase-hue); animation:act-flicker .7s steps(1) infinite; }
/* the reading: every spread card shares one cycle (classes are added in the same frame) */
.spread.reading .card{ animation:act-flicker 7s steps(1) 1; }
@media (prefers-reduced-motion: reduce){ .card.activated *{ animation:none !important; } }

/* ==================================================================
 *  v13b — BOOT SEQUENCE + sound toggle
 * ================================================================== */
.sfx-toggle{
  margin-left:14px; vertical-align:middle; font:700 9px/1 'Space Mono', monospace; letter-spacing:.24em;
  color:var(--cyan); background:transparent; border:1px solid rgba(0,234,255,.45); padding:6px 10px; cursor:pointer;
  text-shadow:0 0 6px var(--cyan);
}
.sfx-toggle:not(.on){ color:rgba(214,242,255,.5); border-color:rgba(214,242,255,.25); text-shadow:none; }

@keyframes boot-scan   { from{ background-position:0 0 } to{ background-position:0 100% } }
@keyframes boot-slices { 0%{ clip-path:inset(0 0 0 0); transform:none }
  10%{ clip-path:inset(12% 0 70% 0); transform:translateX(-4%) }
  20%{ clip-path:inset(40% 0 35% 0); transform:translateX(5%) }
  30%{ clip-path:inset(75% 0 5% 0); transform:translateX(-3%) }
  40%{ clip-path:inset(20% 0 60% 0); transform:translateX(6%) skewX(4deg) }
  50%{ clip-path:inset(0 0 0 0); transform:none }
  60%{ clip-path:inset(55% 0 20% 0); transform:translateX(-6%) }
  70%{ clip-path:inset(5% 0 85% 0); transform:translateX(3%) }
  80%{ clip-path:inset(30% 0 50% 0); transform:translateX(-2%) skewX(-3deg) }
  100%{ clip-path:inset(0 0 0 0); transform:none } }
@keyframes boot-rgb    { 0%,100%{ filter:none } 25%{ filter:drop-shadow(-6px 0 #ff2bd6) drop-shadow(6px 0 #00eaff) } 75%{ filter:drop-shadow(5px 0 #39ff14) drop-shadow(-5px 0 #ff9a3c) } }
@keyframes boot-pop    { 0%{ opacity:0; transform:scale(.86); filter:brightness(4) blur(6px) } 55%{ opacity:1; transform:scale(1.03); filter:brightness(1.8) blur(0) } 100%{ opacity:1; transform:scale(1); filter:none } }
@keyframes boot-frame  { 0%{ opacity:0; filter:brightness(3) } 40%{ opacity:1 } 60%{ opacity:.3 } 100%{ opacity:1; filter:none } }
@keyframes boot-cursor { 50%{ opacity:0 } }

/* stage 1: black plate, everything hidden, code log typing */
.card.booting .field > *:not(.bootlog), .card.booting .frame, .card.booting .three-corner, .card.booting .side-icon,
.card.booting .banner, .card.booting .register, .card.booting .telemetry, .card.booting .rail, .card.booting .mark,
.card.booting .blip, .card.booting .tick, .card.booting .blob, .card.booting .footer, .card.booting .barcode2, .card.booting .holo,
.card.booting.back-card > *:not(.bootlog):not(.edge):not(canvas){ opacity:0; }
.card.booting .edge{ animation:none; border-color:rgba(0,234,255,.35); box-shadow:none; }
.card .bootlog{
  position:absolute; inset:9% 10% 12% 10%; z-index:20; margin:0; overflow:hidden; pointer-events:none;
  font:9px/1.55 'VT323', 'JetBrains Mono', monospace; letter-spacing:.08em; color:var(--acid, #39ff14);
  text-shadow:0 0 6px rgba(57,255,20,.6); white-space:pre-wrap;
  background:
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,0,0,.35) 2px 3px),
    linear-gradient(180deg, rgba(0,234,255,.06), transparent 40%);
  animation:boot-scan 1.2s linear infinite;
}
.card .bootlog::after{ content:"█"; animation:boot-cursor .5s steps(1) infinite; }
/* stage 2: glitch slices (the whole plate) */
.card.booting.boot-glitch .field > *:not(.bootlog){ opacity:1; }
.card.booting.boot-glitch .field{ animation:boot-slices .45s steps(1) 1, boot-rgb .45s steps(1) 1; }
.card.booting.boot-glitch .bootlog{ opacity:.35; }
/* stage 3: image pops, frame powers on */
.card.booting.boot-pop .field > *:not(.bootlog){ opacity:1; }
.card.booting.boot-pop .field{ animation:boot-pop .55s cubic-bezier(.2,.9,.2,1) 1; }
.card.booting.boot-pop .frame, .card.booting.boot-pop .three-corner, .card.booting.boot-pop .side-icon, .card.booting.boot-pop .banner,
.card.booting.boot-pop .register, .card.booting.boot-pop .telemetry, .card.booting.boot-pop .rail, .card.booting.boot-pop .mark,
.card.booting.boot-pop .blip, .card.booting.boot-pop .tick, .card.booting.boot-pop .blob, .card.booting.boot-pop .footer,
.card.booting.boot-pop .barcode2, .card.booting.boot-pop .holo,
.card.booting.boot-pop.back-card > *:not(.bootlog):not(.edge):not(canvas){ opacity:1; animation:boot-frame .7s steps(1) 1; }
.card.booting.boot-pop .bootlog{ opacity:0; transition:opacity .3s; }

/* ==================================================================
 *  v13.1 — fit tweaks + activation toned down 20%, slow build
 * ================================================================== */
.card[data-slug="hermes"] .field .aperture img.art,
.card[data-slug="hermes"] .field .aperture img.art-glow{ transform:scale(1.14) translateY(-16%); }
.card[data-slug="cronus"] .field .aperture img.art, .card[data-slug="cronus"] .field .aperture img.art-glow,
.card[data-slug="rhea"] .field .aperture img.art,   .card[data-slug="rhea"] .field .aperture img.art-glow{
  transform:scale(.88); transform-origin:50% 100%; object-position:50% 100%;
}
/* slower, quieter activation: longer cycles, lower intensities, everything eases in */
.card.activated{ transform:translateY(-4px) scale(1.01); transition:transform .8s ease; }
.card.activated .frame{ animation-duration:3.4s, 1.5s; filter:brightness(1.18) drop-shadow(0 0 4px var(--phase-hue)); transition:filter 1.2s ease-in; }
.card.activated .edge{ animation-duration:2.4s; }
.card.activated .field .vortex{ animation-duration:14s; opacity:calc(.34 * var(--card-vortex-op,1)); transition:opacity 1.4s ease-in; }
.card.activated .field .spiro{ animation-duration:20s; opacity:.4; transition:opacity 1.4s ease-in; }
.card.activated .field .sphere, .card.activated .field .orbits{ animation-duration:9s; opacity:.45; filter:saturate(1.6) brightness(1.2); transition:filter 1.4s ease-in, opacity 1.4s ease-in; }
.card.activated .field .aperture img.art-glow{ opacity:.6; animation-duration:2.2s, 4.2s; transition:opacity 1.2s ease-in; }
.card.activated .field .aperture img.art{
  filter:drop-shadow(0 0 2px #fff) drop-shadow(0 0 12px var(--god-hue)) drop-shadow(0 0 26px var(--phase-hue)) contrast(1.08) saturate(1.12);
  transition:filter 1.2s ease-in;
}
.card.activated .field::after{ opacity:.7; animation-duration:2s; transition:opacity 1s ease-in; }
.card.activated .register, .card.activated .telemetry, .card.activated .rail, .card.activated .banner, .card.activated .footer,
.card.activated .sigil-row, .card.activated .blip, .card.activated .tick, .card.activated .barcode2{ animation-duration:.8s, 1.4s; }
.card.activated .mark, .card.activated .side-icon, .card.activated .blob{ animation-duration:1.8s; filter:brightness(1.3) drop-shadow(0 0 4px currentColor); }
.card.activated .three-corner canvas.solid3d{ filter:drop-shadow(0 0 6px #fff) drop-shadow(0 0 12px var(--phase-hue)); transition:filter 1.2s ease-in; }
.card.activated .holo{ animation-duration:2.2s; opacity:.8; }
.card.back-card.activated{ animation-duration:1.8s; }
.card.back-card.activated .back-wireframe-fill{ animation-duration:3.2s; filter:drop-shadow(0 0 5px #fff) drop-shadow(0 0 16px var(--phase-hue)); }
.card.back-card.activated .pdf-name, .card.back-card.activated .pdf-roman, .card.back-card.activated .pdf-lbl, .card.back-card.activated .pdf-root-eyebrow{ animation-duration:.8s; }
.card.back-card.activated .pdf-qr{ animation-duration:1.1s; box-shadow:0 0 12px var(--phase-hue); }

/* ==================================================================
 *  v14 — ACTIVATION ON THE KYBER PALETTE
 *  No hue-rotate anywhere (it produced oranges/greens outside the spec).
 *  One animated token, --act, walks the electric wheel:
 *  cyan → azure → violet → magenta → hot → acid → cyan. Amber stays the
 *  register/blip accent only. Every activated element reads --act.
 * ================================================================== */
@property --act { syntax:'<color>'; inherits:true; initial-value:#00eaff; }
@keyframes act-palette{
  0%{ --act:#00eaff } 17%{ --act:#2b8bff } 34%{ --act:#9d4bff } 51%{ --act:#ff2bd6 }
  68%{ --act:#ff10a0 } 85%{ --act:#39ff14 } 100%{ --act:#00eaff }
}
@keyframes act-edge2{ 0%,100%{ box-shadow:0 0 18px var(--act), inset 0 0 30px color-mix(in srgb, var(--act) 30%, transparent) } 50%{ box-shadow:0 0 30px var(--act), inset 0 0 44px color-mix(in srgb, var(--act) 42%, transparent) } }
@keyframes act-text2{ 0%,100%{ text-shadow:-2px 0 var(--crt-red), 2px 0 var(--crt-cyan), 0 0 8px var(--act) } 50%{ text-shadow:-2.6px 0 var(--crt-red), 2.6px 0 var(--crt-cyan), 0 0 14px var(--act) } }
@keyframes act-aura2{ 0%,100%{ opacity:.35; transform:scale(1.04) } 50%{ opacity:.6; transform:scale(1.07) } }

.card.activated{ animation:act-palette 6.4s linear infinite; }
/* frame: recoloured through --act via mask (front); tinted glow only on the back (its mask cuts the ribbon) */
.card.activated:not(.back-card) .frame{
  animation:act-flicker 1.5s steps(1) infinite;
  filter:drop-shadow(0 0 4px var(--act));
  background:var(--act);
  -webkit-mask:url('/assets/frame/frame-crop.png') center/100% 100% no-repeat; mask:url('/assets/frame/frame-crop.png') center/100% 100% no-repeat;
  opacity:1;
}
.card.back-card.activated .frame{ animation:act-flicker 1.5s steps(1) infinite; filter:drop-shadow(0 0 5px var(--act)) brightness(1.15); }
.card.activated .edge{ animation:act-edge2 2.4s ease-in-out infinite; border-color:var(--act); }
/* the god: aura = the god's own silhouette filled with --act, blurred; glow shadows on --act */
.card.activated .field .aperture img.art-glow{ animation:act-aura2 2.4s ease-in-out infinite; filter:blur(14px) saturate(1.4) brightness(1.2); }
.card .field .aperture::after{
  content:""; position:absolute; inset:0; pointer-events:none; z-index:-1; opacity:0;
  background:var(--act); -webkit-mask:var(--art-url) center/contain no-repeat; mask:var(--art-url) center/contain no-repeat;
  -webkit-mask-position:50% 92%; mask-position:50% 92%; transform:scale(1.06); transform-origin:50% 92%;
  filter:blur(12px); mix-blend-mode:screen; transition:opacity 1.2s ease-in;
}
.card.activated .field .aperture::after{ opacity:.55; }
.card.activated .field .aperture img.art{
  filter:drop-shadow(0 0 2px var(--ink)) drop-shadow(0 0 12px var(--act)) drop-shadow(0 0 26px color-mix(in srgb, var(--act) 60%, var(--phase-hue))) contrast(1.06) saturate(1.1);
}
/* laser + instruments + icons read --act; no hue spin */
.card .field::after{ background:linear-gradient(180deg, transparent 0 44%, rgba(232,244,240,.22) 49%, var(--act) 50.5%, rgba(232,244,240,.18) 52%, transparent 57%) 0 0 / 100% 300% no-repeat; }
.card.activated .register, .card.activated .telemetry, .card.activated .rail, .card.activated .banner, .card.activated .footer,
.card.activated .sigil-row, .card.activated .blip, .card.activated .tick, .card.activated .barcode2{ animation:act-text2 .9s ease-in-out infinite, act-flicker 1.6s steps(1) infinite; }
.card.activated .mark, .card.activated .side-icon, .card.activated .blob{ animation:none; background:var(--act); filter:brightness(1.2) drop-shadow(0 0 4px var(--act)); }
.card.activated .blob{ background:radial-gradient(circle at 30% 30%, var(--act), transparent 70%); }
.card.activated .three-corner canvas.solid3d{ filter:drop-shadow(0 0 5px var(--ink)) drop-shadow(0 0 12px var(--act)); }
.card.activated .holo{ background:linear-gradient(115deg, transparent 30%, rgba(232,244,240,.05) 45%, color-mix(in srgb, var(--act) 18%, transparent) 50%, color-mix(in srgb, var(--magenta) 12%, transparent) 55%, transparent 70%); }
/* back */
.card.back-card.activated .back-wireframe-fill{ animation:none; filter:drop-shadow(0 0 5px var(--ink)) drop-shadow(0 0 16px var(--act)); transition:filter 1.2s ease-in; }
.card.back-card.activated .pdf-name, .card.back-card.activated .pdf-roman, .card.back-card.activated .pdf-lbl, .card.back-card.activated .pdf-root-eyebrow{ animation:act-text2 .9s ease-in-out infinite; }
.card.back-card.activated .pdf-qr{ box-shadow:0 0 12px var(--act); border-color:var(--act); }
/* boot RGB split on palette only */
@keyframes boot-rgb{ 0%,100%{ filter:none } 25%{ filter:drop-shadow(-6px 0 var(--magenta)) drop-shadow(6px 0 var(--cyan)) } 75%{ filter:drop-shadow(5px 0 var(--acid)) drop-shadow(-5px 0 var(--violet)) } }

/* ==================================================================
 *  v14.1 — per-god fits, FIXED: the earlier rules lost to the base
 *  `.card.painted.cutout ...` selector on specificity. These win.
 * ================================================================== */
.card.painted.cutout[data-slug="hermes"] .field .aperture img.art,
.card.painted.cutout[data-slug="hermes"] .field .aperture img.art-glow{ transform:scale(1.14) translateY(-16%); transform-origin:50% 92%; object-position:50% 92%; }
.card.painted.cutout[data-slug="prometheus"] .field .aperture img.art,
.card.painted.cutout[data-slug="prometheus"] .field .aperture img.art-glow,
.card.painted.cutout[data-slug="cronus"] .field .aperture img.art,
.card.painted.cutout[data-slug="cronus"] .field .aperture img.art-glow,
.card.painted.cutout[data-slug="rhea"] .field .aperture img.art,
.card.painted.cutout[data-slug="rhea"] .field .aperture img.art-glow,
.card.painted.cutout[data-slug="hecate"] .field .aperture img.art,
.card.painted.cutout[data-slug="hecate"] .field .aperture img.art-glow{
  transform:scale(.884); transform-origin:50% 100%; object-position:50% 100%;
}
/* Hades: his render crops the crown of his hair, so anchoring him to the bottom left a
   band of dead space above the head. Anchor to the TOP instead and scale up slightly so
   the hair meets the frame edge. */
.card.painted.cutout[data-slug="hades"] .field .aperture img.art,
.card.painted.cutout[data-slug="hades"] .field .aperture img.art-glow{
  transform:scale(1.06); transform-origin:50% 0%; object-position:50% 0%;
}

/* ===== v15 — MYTH ARCANA (full-bleed scene cards) ===== */
.card[data-slug="zeus-myth2"] .field .aperture img.art,
.card[data-slug="zeus-myth2"] .field .aperture img.art-glow,
.card[data-slug="zeus-myth2"] .field .art-under{ transform:scale(1.09) translateY(4.5%); transform-origin:50% 50%; }
/* demeter-myth5: the approved art (Card Review 2026-09-15) is a full composition, head above the lit door
   and the initiates; Niko 2026-09-15: "shrink it so that it nests itself in the borders" */
.card[data-slug="demeter-myth5"] .field .art-under{ object-fit:contain; object-position:50% 50%; }
.back-v9.back-myth .pdf-name{ font-size:11px; letter-spacing:.22em; white-space:nowrap; }
.back-v9.back-myth .pdf-sub{ margin-top:5px; }

/* v16 — long myth names in the front banner (Cronus card) */
.card[data-slug="zeus-myth1"] .banner .band .nm{ font-size:.78em; letter-spacing:.12em; text-indent:.12em; }
.card[data-slug="hera-genesis"] .banner .band .nm{ font-size:.78em; letter-spacing:.12em; text-indent:.12em; }
.card[data-slug="hera-myth1"] .banner .band .nm{ font-size:.78em; letter-spacing:.12em; text-indent:.12em; }
.card[data-slug="hera-myth3"] .banner .band .nm{ font-size:.78em; letter-spacing:.12em; text-indent:.12em; }
.card[data-slug="poseidon-genesis"] .banner .band .nm{ font-size:.78em; letter-spacing:.12em; text-indent:.12em; }
.card[data-slug="poseidon-myth1"] .banner .band .nm{ font-size:.78em; letter-spacing:.12em; text-indent:.12em; }
.card[data-slug="poseidon-myth3"] .banner .band .nm{ font-size:.62em; letter-spacing:.08em; }
.card[data-slug="poseidon-myth3-back"] .pdf-name{ font-size:8.5px; letter-spacing:.14em; }
.card[data-slug="poseidon-myth4-back"] .pdf-sub{ white-space:nowrap; }
.card[data-slug="demeter-genesis"] .banner .band .nm{ font-size:.58em; letter-spacing:.06em; }
.card[data-slug="demeter-myth2"] .banner .band .nm{ font-size:.62em; letter-spacing:.08em; }
.card[data-slug="demeter-myth3"] .banner .band .nm{ font-size:.62em; letter-spacing:.08em; }
.card[data-slug="demeter-myth1"] .banner .band .nm{ font-size:.74em; letter-spacing:.10em; }
.card[data-slug="demeter-myth4"] .banner .band .nm{ font-size:.74em; letter-spacing:.10em; }
.card[data-slug="demeter-myth5"] .banner .band .nm{ font-size:.74em; letter-spacing:.10em; }
.card[data-slug="demeter-genesis-back"] .pdf-name{ font-size:8px; letter-spacing:.12em; }
.card[data-slug="demeter-myth3-back"] .pdf-name{ font-size:8.5px; letter-spacing:.14em; }
.card[data-slug="athena-genesis"] .banner .band .nm{ font-size:.62em; letter-spacing:.08em; }
.card[data-slug="athena-myth1"] .banner .band .nm{ font-size:.70em; letter-spacing:.10em; }
.card[data-slug="athena-myth2"] .banner .band .nm{ font-size:.54em; letter-spacing:.05em; }
.card[data-slug="athena-myth3"] .banner .band .nm{ font-size:.74em; letter-spacing:.10em; }
.card[data-slug="athena-myth4"] .banner .band .nm{ font-size:.70em; letter-spacing:.10em; }
.card[data-slug="athena-myth5"] .banner .band .nm{ font-size:.74em; letter-spacing:.10em; }
.card[data-slug="athena-myth2-back"] .pdf-name{ font-size:8.5px; letter-spacing:.14em; }
.card[data-slug="athena-genesis-back"] .pdf-name{ font-size:9px; letter-spacing:.14em; }
.card[data-slug="hermes-genesis"] .banner .band .nm{ font-size:.74em; letter-spacing:.08em; }
.card[data-slug="hermes-genesis-back"] .pdf-name{ font-size:10px; letter-spacing:.18em; }
.back-v9.back-myth .pdf-root-body{ -webkit-line-clamp:3; }

/* ==================================================================
 *  v17 — STORY LAYER (myth cards): delight lives in the FRAME, the story stays in the plate.
 *  Codex: Exo 2 italic beige = the oracle's voice (no ghost) · VT323 rails · Space Mono register ·
 *  one phase hue + amber · glide never bounce · reduced-motion keeps scanlines/ghost.
 * ================================================================== */
/* 9. non-flagship story cards: no animated weather over the art — the story IS the background */
.card.myth.story .vortex, .card.myth.story .sphere, .card.myth.story .orbits, .card.myth.story .spiro,
.card.myth.story .field > canvas.constellation, .card.myth.story .field::after{ display:none !important; }
.card.myth.story .field .aperture img.art-glow{ opacity:0 !important; }

/* 1. story micrographics — four side slots, glide-swap through the myth's symbols */
.card.myth .side-icon.story-icon{ transition:opacity .42s ease-out, transform .42s ease-out; }
.card.myth .side-icon.story-icon.swap{ opacity:0; transform:translateY(-4px); }
.card .side-icon.l2{ left:.6cqw; top:62%; }
.card .side-icon.r2{ right:.6cqw; top:30%; }
.card.myth .side-icon{ width:9cqw; height:9cqw; opacity:1; filter:drop-shadow(0 0 5px var(--god-hue, var(--phase-hue))) brightness(1.25); }

/* 3. the oracle whisper — the one-line surfaces over the subtitle on activation */
.card .banner .band{ position:relative; }
.card .banner .whisper{
  position:absolute; left:6px; right:6px; bottom:3px;
  font-family:'Exo 2',sans-serif; font-style:italic; font-weight:400; font-size:7px; letter-spacing:.04em; line-height:1.15;
  color:var(--beige, #dfd2b4); text-shadow:none; opacity:0; transform:translateY(3px);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; pointer-events:none;
  transition:opacity .5s ease-out .15s, transform .5s ease-out .15s;
}
.card .banner .sub{ transition:opacity .35s ease-out; }
.card.myth.activated .banner .sub{ opacity:0; }
.card.myth.activated .banner .whisper{ opacity:1; transform:translateY(0); }

/* 5. register pips = the story number (Space Mono instrument, amber) */
.card .register .pips{ font-family:'Space Mono',ui-monospace,monospace; font-size:7px; letter-spacing:.12em; color:var(--amber); opacity:.9; margin-right:3px; text-shadow:0 0 4px var(--crt-amber); }

/* 7. frame-only parallax on story cards: instruments float, the plate stays still */
.card.myth.story .frame, .card.myth.story .register, .card.myth.story .telemetry, .card.myth.story .rail,
.card.myth.story .mark, .card.myth.story .side-icon, .card.myth.story .sigil-row,
.card.myth.story .banner, .card.myth.story .footer, .card.myth.story .barcode2{
  transform:translate(calc(var(--tilt-x,0px) * -1.6), calc(var(--tilt-y,0px) * -1.6));
  transition:transform .35s ease-out;
}
/* the notch solids already carry a centring transform — compose the parallax into it */
.card.myth.story .three-corner.tm{ transform:translate3d(calc(-50% + var(--tilt-x,0px) * -1.6), calc(var(--tilt-y,0px) * -1.6), 0); transition:transform .35s ease-out; }
.card.myth.story .three-corner.bm{ transform:translate3d(calc(-50% + var(--tilt-x,0px) * -1.6), calc(var(--tilt-y,0px) * -1.6), 0); transition:transform .35s ease-out; }
.card.myth.story .side-icon.story-icon{ transition:opacity .42s ease-out, transform .35s ease-out; }
.card.myth.story .side-icon.story-icon.swap{ transform:translate(calc(var(--tilt-x,0px) * -1.6), calc(var(--tilt-y,0px) * -1.6 - 4px)); }
@media (prefers-reduced-motion: reduce){
  .card.myth.story .frame, .card.myth.story .register, .card.myth.story .telemetry, .card.myth.story .rail, .card.myth.story .mark,
  .card.myth.story .side-icon, .card.myth.story .sigil-row, .card.myth.story .banner, .card.myth.story .footer{ transform:none; }
  .card.myth.story .three-corner.tm, .card.myth.story .three-corner.bm{ transform:translate3d(-50%,0,0); }
}
/* story symbols on the myth back: a row of micrographics between the columns and the blurb */
/* myth back: the last rule for .back-v9 columns is 38.5% (l.2168); a four-row
   dossier from there ran into the story icons and the blurb (Niko, 2026-09-16:
   "bring it up more ... or lower the paragraph a line as well") -- both done. */
.back-v9.back-myth .pdf-col-left,
.back-v9.back-myth .pdf-col-right{ top:34.5%; }
/* QR a touch down and the same touch left (Niko, 2026-09-16) */
.back-v9.back-myth .pdf-qr{ transform:translate(-2cqw, 2cqw); }
.back-v9.back-myth .pdf-story-icons{ position:absolute; left:50%; top:60.5%; transform:translateX(-50%); display:flex; gap:2.2cqw; z-index:6; pointer-events:none; }
.back-v9.back-myth .pdf-story-icons i{ width:6cqw; height:6cqw; display:block; background:var(--phase-hue); opacity:.85;
  -webkit-mask:var(--icon) center/contain no-repeat; mask:var(--icon) center/contain no-repeat; filter:drop-shadow(0 0 4px var(--phase-hue)); }

/* myth backs: the ~45-word synopsis gets one more line and a hair less leading */
.back-v9.back-myth .pdf-blurb{ -webkit-line-clamp:6; line-height:1.3; font-size:7.4px; }
.back-v9.back-myth .pdf-blurb{ top:67.5%; }  /* a line lower: the dossier's last row was stepping on it (Niko, 2026-09-16) */

/* ==================================================================
 *  SHARE MODE — ?share=<slug>: one card on the void, framed for a 1080×1920 phone capture (tools/share.mjs)
 * ================================================================== */
body.share-mode > *:not(#deck-section){ display:none !important; }
body.share-mode #deck-section .wrap > *:not(.deck){ display:none !important; }
body.share-mode{ background:var(--void, #08080b); overflow:hidden; margin:0; }
body.share-mode #deck-section, body.share-mode #deck-section .wrap{ padding:0; margin:0; max-width:none; width:100vw; }
body.share-mode .deck{ display:grid; place-items:center; grid-template-columns:1fr; width:100vw; height:100vh; padding:0; gap:0; }
body.share-mode .deck .card-cell{ width:min(94vw, calc(100vh * .6065 * .92)) !important; max-width:none !important; }

/* ==================================================================
 *  SECTIONED DECK — one sector at a time
 *  218 cards x ~116 nodes = 25k DOM nodes, each running infinite
 *  animations that composite off-screen too. Building a group only on
 *  first open keeps the live card count near a dozen.
 * ================================================================== */
.grp{ margin:0 0 14px; padding:0; }   /* the page's generic `section` rule adds 60px/32px */
.grp-head{
  display:grid; width:100%; cursor:pointer; text-align:left;
  grid-template-columns:auto auto auto 1fr; align-items:baseline; gap:14px;
  padding:14px 18px; background:linear-gradient(90deg, rgba(0,234,255,.05), transparent 60%);
  border:1px solid var(--line,#1e2a33); border-left:2px solid var(--cyan);
  color:var(--text); font-family:Orbitron,sans-serif; letter-spacing:.18em;
  transition:background .25s ease, border-color .25s ease;
}
.grp-head:hover{ background:linear-gradient(90deg, rgba(0,234,255,.10), transparent 60%); border-left-color:var(--magenta); }
.grp-head:focus-visible{ outline:1px solid var(--cyan); outline-offset:2px; }
.grp-caret{ font-size:10px; color:var(--cyan); transition:transform .18s ease; }
.grp-head[aria-expanded="true"] .grp-caret{ transform:rotate(0deg); }
.grp-head[aria-expanded="false"] .grp-caret{ transform:rotate(-90deg); }
.grp-title{ font-size:13px; font-weight:700; }
.grp-count{
  font-family:'Space Mono',ui-monospace,monospace; font-size:9px; letter-spacing:.14em;
  color:var(--amber); border:1px solid var(--amber); padding:2px 8px; white-space:nowrap;
}
.grp-note{
  font-family:'Exo 2',sans-serif; font-style:italic; letter-spacing:.02em;
  font-size:11px; color:var(--dim,#7d8f9a); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.grp-body{ padding:18px 0 4px; }
.grp-body[hidden]{ display:none !important; }
@media (max-width:720px){
  .grp-head{ grid-template-columns:auto 1fr auto; gap:10px; padding:12px 14px; }
  .grp-note{ display:none; }
}

/* ==================================================================
 *  GENEALOGY MAP — 2D canvas
 *  Deck tokens only. Sector reads as colour because the map is an
 *  instrument panel, not a card composition. No hue-rotate anywhere.
 * ================================================================== */
#map-section .wrap{ max-width:1400px; }
.cm-stage{
  position:relative; width:100%; height:min(78dvh,860px);
  border:1px solid var(--line,#1e2a33); border-left:2px solid var(--cyan);
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(0,234,255,.045), transparent 60%),
    radial-gradient(100% 80% at 75% 80%, rgba(255,43,214,.035), transparent 60%),
    var(--void);
  overflow:hidden; touch-action:none;
}
#cm-canvas{ display:block; width:100%; height:100%; cursor:grab; }
#cm-canvas:active{ cursor:grabbing; }

.cm-legend{
  position:absolute; left:14px; bottom:12px; display:flex; flex-wrap:wrap; gap:14px;
  font-family:'Space Mono',ui-monospace,monospace; font-size:9px; letter-spacing:.14em;
  color:var(--dim,#7d8f9a); pointer-events:none;
}
.cm-legend span{ display:inline-flex; align-items:center; gap:6px; }
.cm-legend i{ width:8px; height:8px; border-radius:50%; display:block; }
.cm-legend i.l-parent{ width:16px; height:0; border-top:1.5px solid var(--beige); border-radius:0; }
.cm-legend i.l-cast{ width:16px; height:0; border-top:1.5px dashed var(--magenta); border-radius:0; }
.cm-legend .cm-sep{ width:1px; height:11px; background:var(--line,#1e2a33); }

.cm-hint{
  position:absolute; right:14px; top:12px; max-width:44ch; text-align:right;
  font-family:'Exo 2',sans-serif; font-style:italic; font-size:11px; line-height:1.5;
  color:var(--dim,#7d8f9a); pointer-events:none;
}

#cm-panel{
  position:absolute; right:14px; bottom:14px; width:min(330px,calc(100% - 28px));
  background:rgba(10,14,20,.94); border:1px solid var(--line,#1e2a33);
  border-left:2px solid var(--cyan); padding:16px 18px 18px;
  backdrop-filter:blur(6px);
}
#cm-panel[hidden]{ display:none !important; }
#cm-panel h3{ font-family:Orbitron,sans-serif; font-size:15px; letter-spacing:.14em; margin:2px 0 6px; }
.cm-eyebrow{ font-family:'Space Mono',ui-monospace,monospace; font-size:9px; letter-spacing:.2em; }
.cm-title{ font-family:'Space Mono',ui-monospace,monospace; font-size:10px; letter-spacing:.08em;
  color:var(--amber); margin:0 0 8px; line-height:1.45; }
.cm-trans{ font-family:'Exo 2',sans-serif; font-style:italic; font-size:12.5px; line-height:1.55;
  color:var(--beige); margin:0 0 12px; }
.cm-row{ display:flex; justify-content:space-between; gap:14px; font-size:11px;
  font-family:'JetBrains Mono',monospace; padding:4px 0; border-top:1px solid rgba(30,42,51,.7); }
.cm-row span{ color:var(--dim,#7d8f9a); letter-spacing:.08em; text-transform:uppercase; font-size:9.5px; }
.cm-row b{ color:var(--text); font-weight:500; text-align:right; text-transform:capitalize; }
.cm-note{ font-family:'Exo 2',sans-serif; font-style:italic; font-size:11px; color:var(--dim,#7d8f9a);
  margin:10px 0 0; line-height:1.45; }
.cm-go{ display:inline-block; margin-top:12px; font-family:Orbitron,sans-serif; font-size:10px;
  letter-spacing:.18em; color:var(--cyan); text-decoration:none; border:1px solid var(--cyan);
  padding:6px 12px; transition:background .2s ease, color .2s ease; }
.cm-go:hover{ background:var(--cyan); color:var(--void); }
.cm-close{ position:absolute; right:8px; top:6px; background:none; border:0; cursor:pointer;
  color:var(--dim,#7d8f9a); font-size:19px; line-height:1; padding:4px 7px; }
.cm-close:hover{ color:var(--text); }

@media (max-width:720px){
  .cm-stage{ height:64dvh; }
  .cm-hint{ display:none; }
  #cm-panel{ left:14px; right:14px; width:auto; }
  .cm-legend{ font-size:8px; gap:9px; }
}

/* ---- map view toggle + WebGL stage ---- */
.cm-modes{ display:flex; gap:0; margin:0 0 12px; }
.cm-mode{
  background:none; border:1px solid var(--line,#1e2a33); border-right-width:0;
  color:var(--dim,#7d8f9a); cursor:pointer; padding:7px 16px;
  font-family:Orbitron,sans-serif; font-size:9.5px; letter-spacing:.2em;
  transition:color .2s ease, border-color .2s ease, background .2s ease;
}
.cm-mode:last-child{ border-right-width:1px; }
.cm-mode:hover{ color:var(--text); }
.cm-mode[aria-pressed="true"]{
  color:var(--void); background:var(--cyan); border-color:var(--cyan);
}
.cm-mode:focus-visible{ outline:1px solid var(--cyan); outline-offset:2px; }

#c3-canvas{ position:absolute; inset:0; }
#c3-canvas canvas{ display:block; width:100%; height:100%; cursor:grab; }
#c3-canvas canvas:active{ cursor:grabbing; }
/* the side index: the old legend, promoted from a static key into the
   category filter. Same colours and vocabulary, now clickable. */
.c3-index{
  position:absolute; left:14px; top:50%; transform:translateY(-50%);
  display:flex; flex-direction:column; gap:2px; z-index:3;
  font-family:'Space Mono',ui-monospace,monospace; font-size:9px; letter-spacing:.14em;
  color:var(--dim,#7d8f9a);
  background:rgba(10,14,20,.82); border:1px solid var(--line,#1e2a33);
  padding:9px 10px 8px; backdrop-filter:blur(6px);
}
.c3-index-hd{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  font-size:8.5px; letter-spacing:.2em; color:var(--dim,#7d8f9a);
  padding-bottom:6px; margin-bottom:3px; border-bottom:1px solid var(--line,#1e2a33);
}
.c3-index-all{
  background:none; border:0; cursor:pointer; padding:1px 4px;
  font:inherit; letter-spacing:.16em; color:var(--cyan); opacity:.75;
}
.c3-index-all:hover{ opacity:1; }
.c3-cat{
  display:flex; align-items:center; gap:7px; width:100%;
  background:none; border:0; padding:4px 5px; cursor:pointer;
  font:inherit; letter-spacing:.14em; color:var(--dim,#7d8f9a);
  text-align:left; opacity:.42; transition:opacity .16s ease, color .16s ease;
}
.c3-cat:hover{ opacity:.8; color:var(--text); }
.c3-cat.is-on{ opacity:1; color:var(--text); }
.c3-cat i{ width:8px; height:8px; border-radius:50%; display:block; flex:0 0 auto;
  filter:grayscale(1); transition:filter .16s ease; }
.c3-cat.is-on i{ filter:none; }
.c3-cat-nm{ flex:1 1 auto; }
.c3-cat-n{ color:var(--dim,#7d8f9a); font-size:8.5px; opacity:.75; font-variant-numeric:tabular-nums; }
.c3-index-ft{
  display:flex; align-items:center; gap:6px; flex-wrap:wrap;
  margin-top:6px; padding-top:6px; border-top:1px solid var(--line,#1e2a33);
  font-size:8px; letter-spacing:.12em;
}
.c3-index-ft i{ width:14px; height:0; display:block; }
.c3-index-ft i.l-parent{ border-top:1.5px solid var(--beige); }
.c3-index-ft i.l-cast{ border-top:1.5px dashed var(--magenta); }
.c3-hint{
  position:absolute; right:14px; top:12px; max-width:44ch; text-align:right; z-index:2;
  font-family:'Exo 2',sans-serif; font-style:italic; font-size:11px; line-height:1.5;
  color:var(--dim,#7d8f9a); pointer-events:none;
}
#c3-panel{
  position:absolute; right:14px; bottom:14px; width:min(330px,calc(100% - 28px)); z-index:3;
  background:rgba(10,14,20,.94); border:1px solid var(--line,#1e2a33);
  border-left:2px solid var(--cyan); padding:16px 18px 18px; backdrop-filter:blur(6px);
}
#c3-panel[hidden]{ display:none !important; }
#c3-panel h3{ font-family:Orbitron,sans-serif; font-size:15px; letter-spacing:.14em; margin:2px 0 6px; }
.c3-eyebrow{ font-family:'Space Mono',ui-monospace,monospace; font-size:9px; letter-spacing:.2em; }
.c3-title{ font-family:'Space Mono',ui-monospace,monospace; font-size:10px; letter-spacing:.08em;
  color:var(--amber); margin:0 0 8px; line-height:1.45; }
.c3-trans{ font-family:'Exo 2',sans-serif; font-style:italic; font-size:12.5px; line-height:1.55;
  color:var(--beige); margin:0 0 12px; }
.c3-row{ display:flex; justify-content:space-between; gap:14px; font-size:11px;
  font-family:'JetBrains Mono',monospace; padding:4px 0; border-top:1px solid rgba(30,42,51,.7); }
.c3-row span{ color:var(--dim,#7d8f9a); letter-spacing:.08em; text-transform:uppercase; font-size:9.5px; }
.c3-row b{ color:var(--text); font-weight:500; text-align:right; text-transform:capitalize; }
.c3-note{ font-family:'Exo 2',sans-serif; font-style:italic; font-size:11px;
  color:var(--dim,#7d8f9a); margin:10px 0 0; line-height:1.45; }
.c3-close{ position:absolute; right:8px; top:6px; background:none; border:0; cursor:pointer;
  color:var(--dim,#7d8f9a); font-size:19px; line-height:1; padding:4px 7px; }
.c3-close:hover{ color:var(--text); }
@media (max-width:720px){
  .c3-hint{ display:none; }
  #c3-panel{ left:14px; right:14px; width:auto; }
  .c3-index{ font-size:8px; padding:7px 8px; left:8px; }
  .c3-index-ft{ display:none; }
}

/* ============ tier-2 god dossier (#/god/<slug>) ============
   Accent is per-god: --h is set inline from the flagship's PHASE hue, so the
   page recolours as you walk the pantheon using palette tokens only. */
#god-page{
  max-width:1080px; margin:0 auto; padding:26px 20px 90px;
}
#god-page[hidden]{ display:none !important; }
/* While a dossier is open, every other top-level block is out of the way.
   Stated as "hide all siblings" rather than by tag: the masthead is a <header>
   and the colophon a <footer>, and a future sibling should be covered too. */
body.god-open > :not(#god-page):not(script):not(style){ display:none !important; }

.gp-back{
  background:none; border:1px solid var(--line,#1e2a33); color:var(--dim,#7d8f9a);
  font-family:Orbitron,sans-serif; font-size:10px; letter-spacing:.2em;
  padding:8px 14px; cursor:pointer; margin:0 0 24px;
  transition:color .18s ease, border-color .18s ease;
}
.gp-back:hover{ color:var(--cyan); border-color:var(--cyan); }

.gp-hero{
  display:grid; grid-template-columns:minmax(0,320px) minmax(0,1fr); gap:40px;
  align-items:center; padding:0 0 26px; border-bottom:1px solid var(--line,#1e2a33);
}
/* the real card in the dossier hero — it sizes itself from the column width */
.gp-hero-card{ width:100%; }
/* Do NOT re-declare the ratio here. The base `.card` rule owns it (0.6065);
   forcing 3/4 squashed the plate ~19% shorter than designed (at 320px wide:
   528px -> 427px). Every child inherits that distorted frame — .field and
   .aperture fill the wrong shape, and the art, fitted with object-fit:contain,
   is scaled against a box a fifth too short, which drove heads into the top
   notch. `height:auto` lets the card's own aspect-ratio set the height. */
.gp-hero-card .card{ width:100%; height:auto; }
.gp-hero-art{
  width:100%; height:auto; aspect-ratio:3/4; object-fit:cover; display:block;
  filter:drop-shadow(0 0 26px color-mix(in srgb, var(--h) 34%, transparent));
}
.gp-eyebrow{
  font-family:'JetBrains Mono',monospace; font-size:10px; letter-spacing:.28em;
  color:var(--h); opacity:.85; margin:0 0 10px;
}
.gp-name{
  font-family:Orbitron,sans-serif; font-weight:900;
  font-size:clamp(30px,5.4vw,58px); letter-spacing:.06em;
  color:var(--ink); margin:0 0 8px; line-height:1.02;
}
.gp-title{
  font-family:'Space Mono',ui-monospace,monospace; font-size:12px; letter-spacing:.1em;
  color:var(--amber); margin:0 0 12px; line-height:1.5;
}
.gp-sub{
  font-family:'Exo 2',sans-serif; font-style:italic; font-weight:300;
  font-size:17px; color:var(--beige); margin:0 0 16px;
}
.gp-trans{
  font-family:'Exo 2',sans-serif; font-style:italic; font-size:14.5px; line-height:1.6;
  color:var(--text); margin:0; padding-left:14px; border-left:2px solid var(--h);
  max-width:60ch;
}

.gp-facts{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr));
  gap:0 30px; margin:20px 0 0;
}
.gp-fact{
  display:flex; flex-direction:column; gap:3px; padding:11px 0;
  border-top:1px solid rgba(30,42,51,.7);
}
.gp-fact span{
  font-family:'JetBrains Mono',monospace; font-size:9px; letter-spacing:.2em;
  color:var(--dim,#7d8f9a);
}
.gp-fact b{
  font-family:'JetBrains Mono',monospace; font-size:12.5px; font-weight:500;
  color:var(--text); text-transform:capitalize;
}

.gp-block{ margin:40px 0 0; }
.gp-h2{
  font-family:Orbitron,sans-serif; font-weight:700; font-size:12px; letter-spacing:.3em;
  color:var(--h); margin:0 0 16px; padding-bottom:9px;
  border-bottom:1px solid color-mix(in srgb, var(--h) 26%, transparent);
}

.gp-lin{ display:flex; gap:18px; align-items:baseline; padding:8px 0; flex-wrap:wrap; }
.gp-lin > span{
  font-family:'JetBrains Mono',monospace; font-size:9px; letter-spacing:.2em;
  color:var(--dim,#7d8f9a); min-width:82px;
}
.gp-lin > div{ display:flex; flex-wrap:wrap; gap:8px; }
.gp-rel{
  font-family:'JetBrains Mono',monospace; font-size:12px; text-decoration:none;
  color:var(--text); border:1px solid var(--line,#1e2a33); padding:4px 10px;
  transition:color .16s ease, border-color .16s ease;
}
a.gp-rel:hover{ color:var(--h); border-color:var(--h); }
.gp-rel-off{ color:var(--dim,#7d8f9a); opacity:.6; border-style:dashed; cursor:help; }

.gp-arc{
  font-family:'Exo 2',sans-serif; font-size:15px; line-height:1.7; color:var(--beige);
  margin:0 0 18px; max-width:70ch;
}
.gp-arc b{ color:var(--ink); font-weight:600; }
.gp-arc i{ color:var(--text); }
.gp-q{
  font-family:'Exo 2',sans-serif; font-style:italic; font-size:15px; line-height:1.65;
  color:var(--ink); margin:0; padding:14px 0 14px 18px;
  border-left:2px solid var(--h); max-width:66ch;
}

.gp-myths{ display:flex; flex-direction:column; gap:2px; }
.gp-myth{
  display:grid; grid-template-columns:208px minmax(0,1fr); gap:26px;
  padding:24px 0; border-top:1px solid rgba(30,42,51,.7);
}
/* myth thumbnails carry the same electric edge as the map thumbnails:
   the animated --act colour, not a static rule. */
.gp-myth-art{
  width:100%; height:auto; display:block; border-radius:10px;
  border:1px solid var(--act);
  animation:act-palette 6.4s linear infinite, act-edge2 2.4s ease-in-out infinite;
}
.gp-myth-noart{
  aspect-ratio:3/4; display:grid; place-items:center; border-radius:10px;
  color:var(--dim,#7d8f9a); font-size:26px; background:rgba(255,255,255,.02);
}
.gp-myth-head{ display:flex; align-items:baseline; gap:12px; margin:0 0 6px; }
.gp-myth-roman{
  font-family:'JetBrains Mono',monospace; font-size:10px; letter-spacing:.18em; color:var(--h);
}
.gp-myth h3{
  font-family:Orbitron,sans-serif; font-weight:700; font-size:14px; letter-spacing:.14em;
  color:var(--ink); margin:0;
}
.gp-myth-name{
  font-family:'Space Mono',ui-monospace,monospace; font-size:11px; letter-spacing:.08em;
  color:var(--amber); margin:0 0 10px;
}
.gp-myth-syn{
  font-family:'Exo 2',sans-serif; font-size:14px; line-height:1.65; color:var(--beige);
  margin:0 0 10px; max-width:68ch;
}
.gp-myth-trans{
  font-family:'Exo 2',sans-serif; font-style:italic; font-size:13px; line-height:1.6;
  color:var(--text); margin:0 0 10px; padding-left:12px;
  border-left:1px solid color-mix(in srgb, var(--h) 44%, transparent); max-width:64ch;
}
.gp-myth-kw{ display:flex; flex-wrap:wrap; gap:7px; margin:0; }
.gp-myth-kw span{
  font-family:'JetBrains Mono',monospace; font-size:9.5px; letter-spacing:.1em;
  color:var(--dim,#7d8f9a); border:1px solid var(--line,#1e2a33); padding:3px 8px;
}
.gp-empty{
  font-family:'Exo 2',sans-serif; font-style:italic; font-size:15px;
  color:var(--dim,#7d8f9a); margin:34px 0;
}
.gp-src{
  font-family:'JetBrains Mono',monospace; font-size:9.5px; letter-spacing:.12em;
  color:var(--dim,#7d8f9a); opacity:.65; margin:48px 0 0;
  padding-top:14px; border-top:1px solid rgba(30,42,51,.7);
}

@media (max-width:720px){
  .gp-hero{ grid-template-columns:1fr; gap:20px; }
  .gp-hero-art{ max-width:270px; }
  .gp-myth{ grid-template-columns:120px minmax(0,1fr); gap:16px; }
  .gp-lin > span{ min-width:0; flex-basis:100%; }
}

.c3-go{ display:inline-block; margin-top:12px; font-family:Orbitron,sans-serif; font-size:10px;
  letter-spacing:.18em; color:var(--cyan); text-decoration:none; border:1px solid var(--cyan);
  padding:6px 12px; transition:background .2s ease, color .2s ease; }
.c3-go:hover{ background:var(--cyan); color:var(--void); }

/* ============ THE LINEAGE — chapter view ============ */
.ln-ch{ margin:0 0 46px; padding:0; }
.ln-ch-head{ margin:0 0 18px; padding-bottom:11px; border-bottom:1px solid var(--line,#1e2a33); }
.ln-ch-head h3{
  font-family:Orbitron,sans-serif; font-weight:900; font-size:clamp(17px,2.4vw,25px);
  letter-spacing:.16em; color:var(--ink); margin:0 0 6px;
}
.ln-ch-head p{
  font-family:'Exo 2',sans-serif; font-style:italic; font-size:14px;
  color:var(--beige); margin:0 0 6px;
}
.ln-ch-meta{
  font-family:'JetBrains Mono',monospace; font-size:9.5px; letter-spacing:.18em;
  color:var(--dim,#7d8f9a);
}

.ln-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(124px,1fr)); gap:10px; align-items:start; }
/* the open tile stays in place in the grid, just marked "selected" */
.ln-fig.is-open .ln-card{ border-color:var(--cyan); background:rgba(0,234,255,.07); }

.ln-card{
  display:flex; flex-direction:column; align-items:stretch; gap:0; width:100%;
  background:rgba(255,255,255,.015); border:1px solid var(--line,#1e2a33);
  padding:0 0 9px; cursor:pointer; text-align:center; overflow:hidden;
  transition:border-color .18s ease, background .18s ease;
}
.ln-card .ln-nm{ margin-top:8px; padding:0 6px; }
.ln-card:hover{ border-color:var(--cyan); background:rgba(0,234,255,.05); }
.ln-fig.is-open .ln-card{ border-color:var(--cyan); background:rgba(0,234,255,.05); }
/* the thumbnail wears the deck's real plate silhouette (chamfers + notches),
   clipped with the same path plate.js gives a full card */
.ln-art{ display:block; width:100%; aspect-ratio:100/133; position:relative; }
/* The image must NOT be allowed to size .ln-art. With `height:100%` in normal
   flow, a percentage height against an aspect-ratio-derived parent is circular,
   so the browser falls back to the image's INTRINSIC height and pushes the box
   taller. For 3:4 art (0.75) that matches the declared ratio and hides the bug;
   for the 0.667 art (hecate, prometheus, cronus, rhea) it rendered 187px instead
   of 166px. Taking the image out of flow lets aspect-ratio hold and object-fit
   do the cropping it was always meant to do. */
.ln-art img{
  position:absolute; inset:0;
  width:100%; height:100%; object-fit:cover; display:block; border-radius:10px;
}
.ln-rim{
  position:absolute; inset:0; pointer-events:none; border-radius:10px;
  border:1px solid var(--act);
  animation:act-palette 6.4s linear infinite, act-edge2 2.4s ease-in-out infinite;
}
.ln-card:hover .ln-rim{ animation-duration:3.2s, 1.4s; }
@media (prefers-reduced-motion: reduce){
  .ln-rim{ animation:none; border-color:var(--cyan); }
}
.ln-zoom{
  position:absolute; right:5px; bottom:5px; width:22px; height:22px;
  display:grid; place-items:center; cursor:zoom-in;
  font:12px/1 'JetBrains Mono',monospace; color:var(--void);
  background:var(--cyan); opacity:0; transform:scale(.85);
  transition:opacity .16s ease, transform .16s ease;
}
.ln-card:hover .ln-zoom, .ln-zoom:focus{ opacity:.92; transform:scale(1); outline:none; }
.ln-zoom:focus{ box-shadow:0 0 0 2px var(--ink); }
.ln-noart{ aspect-ratio:3/4; display:grid; place-items:center; color:var(--dim,#7d8f9a); font-size:22px; }
.ln-nm{
  font-family:Orbitron,sans-serif; font-weight:700; font-size:10px; letter-spacing:.13em;
  color:var(--ink); line-height:1.3;
}
.ln-count{
  font-family:'JetBrains Mono',monospace; font-size:8.5px; letter-spacing:.12em;
  color:var(--amber);
}

.ln-x{
  border:1px solid var(--cyan); border-left-width:2px; margin:12px 0 0;
  padding:14px 18px 18px; background:rgba(0,234,255,.04);
}
.ln-x[hidden]{ display:none !important; }
.ln-x-head{ display:flex; align-items:center; gap:12px; margin:0 0 8px; }
.ln-x-nm{
  font-family:Orbitron,sans-serif; font-weight:700; font-size:13px;
  letter-spacing:.18em; color:var(--ink);
}
.ln-x-close{
  margin-left:auto; background:none; border:0; cursor:pointer;
  color:var(--dim,#7d8f9a); font-size:20px; line-height:1; padding:2px 6px;
}
.ln-x-close:hover{ color:var(--text); }
.ln-rel{ display:flex; gap:16px; align-items:baseline; padding:6px 0; flex-wrap:wrap; }
.ln-rel > span{
  font-family:'JetBrains Mono',monospace; font-size:9px; letter-spacing:.2em;
  color:var(--dim,#7d8f9a); min-width:76px;
}
.ln-rel > div{ display:flex; flex-wrap:wrap; gap:7px; }
.ln-chip{
  font-family:'JetBrains Mono',monospace; font-size:11.5px; color:var(--text);
  background:none; border:1px solid var(--line,#1e2a33); padding:5px 11px;
  cursor:pointer; transition:color .16s ease, border-color .16s ease;
}
button.ln-chip:hover{ color:var(--cyan); border-color:var(--cyan); }
/* named in the sheet, no card in the deck — visibly not openable */
.ln-chip-off{ color:var(--dim,#7d8f9a); border-style:dashed; cursor:help; }
/* the sheet's phrasing for a birth with no parent figure (Aphrodite / the sea) */
.ln-chip-abstract{
  color:var(--beige); border-style:dotted; font-style:italic; cursor:default;
}
.ln-none{
  font-family:'Exo 2',sans-serif; font-style:italic; font-size:13px;
  color:var(--dim,#7d8f9a); margin:4px 0 0;
}
.ln-go{
  display:inline-block; margin-top:14px; font-family:Orbitron,sans-serif; font-size:10px;
  letter-spacing:.18em; color:var(--cyan); text-decoration:none;
  border:1px solid var(--cyan); padding:6px 12px;
  transition:background .2s ease, color .2s ease;
}
.ln-go:hover{ background:var(--cyan); color:var(--void); }

@media (max-width:720px){
  .ln-grid{ grid-template-columns:repeat(auto-fill,minmax(98px,1fr)); gap:8px; }
  .ln-rel > span{ min-width:0; flex-basis:100%; }
}

/* The canvas views need a fixed-height viewport to render into; the chapter
   view is a document and must grow to its content instead. */
.cm-stage.is-doc{
  height:auto; min-height:0; overflow:visible;
  padding:22px 20px 8px; border-left-color:var(--magenta);
}
@media (max-width:720px){ .cm-stage.is-doc{ padding:16px 13px 6px; } }


/* ---- lineage lightbox: the card enlarged ---- */
.ln-lb{
  position:fixed; inset:0; z-index:9000; display:grid; place-items:center;
  background:rgba(4,7,11,.93); backdrop-filter:blur(7px); padding:26px;
  animation:ln-lb-in .18s ease both;
}
.ln-lb[hidden]{ display:none !important; }
@keyframes ln-lb-in{ from{ opacity:0 } to{ opacity:1 } }
body.ln-lb-open{ overflow:hidden; }
.ln-lb-fig{ margin:0; display:flex; flex-direction:column; align-items:center; gap:16px; }
.ln-lb-plate{ position:relative; display:block; line-height:0; }
.ln-lb-plate img{
  display:block; max-height:78dvh; max-width:min(92vw,640px); width:auto; height:auto;
  border-radius:12px;
}
.ln-lb-rim{
  position:absolute; inset:0; pointer-events:none; border-radius:12px;
  border:2px solid var(--act);
  animation:act-palette 6.4s linear infinite, act-edge2 2.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce){
  .ln-lb-rim{ animation:none; border-color:var(--cyan); }
}
.ln-lb figcaption{ text-align:center; }
.ln-lb figcaption b{
  display:block; font-family:Orbitron,sans-serif; font-weight:900; font-size:19px;
  letter-spacing:.2em; color:var(--ink); margin-bottom:6px;
}
.ln-lb figcaption span{
  font-family:'Space Mono',ui-monospace,monospace; font-size:11px; letter-spacing:.1em;
  color:var(--amber);
}
.ln-lb-close{
  position:absolute; top:16px; right:20px; background:none; border:0; cursor:pointer;
  color:var(--dim,#7d8f9a); font-size:34px; line-height:1; padding:6px 12px;
}
.ln-lb-close:hover{ color:var(--cyan); }
@media (max-width:720px){
  .ln-lb{ padding:14px; }
  .ln-lb-plate img{ max-height:66dvh; }
}

/* ---------- deep space: relationship tooltip + card popup ---------- */
#c3-tip{
  position:fixed; z-index:60; pointer-events:none; max-width:280px;
  padding:10px 12px; border-radius:8px;
  background:rgba(6,8,12,.94); border:1px solid var(--act);
  animation:act-palette 6.4s linear infinite;
  box-shadow:0 8px 30px rgba(0,0,0,.6);
  font-family:'JetBrains Mono',monospace; font-size:11px; line-height:1.5;
}
.c3-tn{ font-family:Orbitron,sans-serif; font-size:12px; letter-spacing:.14em; margin:0 0 6px; }
.c3-tr{ display:flex; gap:8px; margin:2px 0; color:var(--beige,#dfd2b4); }
.c3-tr span{ flex:0 0 66px; color:var(--dim,#7d8f9a); letter-spacing:.08em; font-size:10px; }
.c3-tr b{ font-weight:500; text-transform:capitalize; }
.c3-tr i{ color:var(--dim,#7d8f9a); }

.c3-pop{ position:fixed; inset:0; z-index:70; display:grid; place-items:center; }
.c3-pop-back{ position:absolute; inset:0; background:rgba(4,6,9,.86); backdrop-filter:blur(3px); }
.c3-pop-stage{ position:relative; display:grid; justify-items:center; gap:14px; }
.c3-pop-zoom{ transition:transform .12s ease-out; transform-origin:center; }
.c3-pop-cell{ width:min(78vw, 46vh); }
.c3-pop-hint{
  margin:0; font-family:'JetBrains Mono',monospace; font-size:10px;
  letter-spacing:.16em; color:var(--dim,#7d8f9a); text-transform:uppercase;
}
.c3-pop-x{
  position:absolute; top:-38px; right:0; z-index:2;
  background:none; border:1px solid var(--line,#1e2a33); color:var(--beige,#dfd2b4);
  width:30px; height:30px; border-radius:6px; cursor:pointer; font-size:17px; line-height:1;
}
.c3-pop-x:hover{ color:var(--cyan); border-color:var(--cyan); }

/* The flip geometry above is scoped to .deck; the popup lives outside it, so
   mirror the same rules for the popup cell rather than widening the deck's. */
.c3-pop-cell{ perspective:1600px; }
.c3-pop-cell .flip-wrap{
  position:relative; width:100%; aspect-ratio:302/482; transform-style:preserve-3d;
}
.c3-pop-cell .flip-inner{
  position:absolute; inset:0; transform-style:preserve-3d;
  transition:transform 900ms cubic-bezier(.5,.1,.3,1); will-change:transform;
}
.c3-pop-cell.flipped .flip-inner{ transform:rotateY(180deg); }

/* The four 0.667-ratio gods (hecate, prometheus, cronus, rhea) are taller than
   the 3:4 thumbnail box, so `cover` crops ~11% of their height. The default
   `object-position:50% 50%` splits that between top and bottom and takes the
   head off. Pin the crop to the TOP so the whole head survives and the trim
   comes off the feet instead. */
.ln-card[data-toggle="hecate"] .ln-art img,
.ln-card[data-toggle="prometheus"] .ln-art img,
.ln-card[data-toggle="cronus"] .ln-art img,
.ln-card[data-toggle="rhea"] .ln-art img{ object-position:50% 0%; }

/* ==================================================================
 *  CONSTELLATIONS — the thematic matrix (map mode 'cx')
 * ================================================================== */
.cx-wrap{ display:grid; grid-template-columns:200px minmax(0,1fr) 250px; gap:0;
  height:min(70vh,660px); background:var(--void,#08080b); }
.cx-stage{ position:relative; overflow:hidden; }
.cx-svg{ width:100%; height:100%; display:block; }
.cx-ring{ fill:none; stroke:var(--act); stroke-width:1; stroke-dasharray:3 5;
  animation:act-palette 6.4s linear infinite; }
.cx-ring.is-unlocked{ stroke-width:1.8; stroke-dasharray:none; }
.cx-spoke{ stroke:rgba(125,143,154,.35); stroke-width:.5; }
.cx-star{ fill:rgba(10,14,20,.9); stroke:var(--act); stroke-width:1.4; cursor:pointer;
  animation:act-palette 6.4s linear infinite; transition:r .18s ease; }
.cx-star.is-held{ fill:var(--act); }
.cx-star:hover{ stroke-width:2.4; }
.cx-label{ fill:var(--text,#e6edf3); font-family:Orbitron,sans-serif; font-size:9px;
  letter-spacing:.18em; text-anchor:middle; pointer-events:none; }
.cx-label.is-unlocked{ fill:var(--acid,#39ff14); }
.cx-count{ fill:var(--dim,#7d8f9a); font-family:'JetBrains Mono',monospace; font-size:9px;
  text-anchor:middle; pointer-events:none; }

.cx-index, .cx-meta{ border-right:1px solid var(--line,#1e2a33); padding:12px 12px 10px;
  overflow-y:auto; background:rgba(10,14,20,.6); }
.cx-meta{ border-right:0; border-left:1px solid var(--line,#1e2a33); }
.cx-index-hd{ display:flex; justify-content:space-between; align-items:center;
  font-family:'Space Mono',monospace; font-size:8.5px; letter-spacing:.2em;
  color:var(--dim,#7d8f9a); padding-bottom:7px; margin-bottom:5px;
  border-bottom:1px solid var(--line,#1e2a33); }
.cx-all{ background:none; border:0; cursor:pointer; font:inherit; letter-spacing:.16em;
  color:var(--cyan); opacity:.75; padding:1px 4px; }
.cx-all:hover{ opacity:1; }
.cx-cat{ display:flex; align-items:center; gap:7px; width:100%; background:none; border:0;
  padding:4px 5px; cursor:pointer; font-family:'Space Mono',monospace; font-size:9px;
  letter-spacing:.13em; color:var(--dim,#7d8f9a); text-align:left; opacity:.85;
  transition:opacity .16s ease,color .16s ease; text-transform:uppercase; }
.cx-cat:hover{ color:var(--text); opacity:1; }
.cx-cat.is-on{ color:var(--text); opacity:1; }
.cx-cat.is-dim{ opacity:.34; }
.cx-cat.is-unlocked .cx-cat-nm{ color:var(--acid,#39ff14); }
.cx-cat i{ width:8px; height:8px; border-radius:50%; flex:0 0 auto; }
.cx-cat-nm{ flex:1 1 auto; }
.cx-cat-n{ font-size:8.5px; opacity:.8; font-variant-numeric:tabular-nums; }
.cx-index-ft{ margin-top:8px; padding-top:8px; border-top:1px solid var(--line,#1e2a33); }
.cx-sim{ display:flex; align-items:center; gap:6px; cursor:pointer;
  font-family:'Space Mono',monospace; font-size:8px; letter-spacing:.12em;
  color:var(--dim,#7d8f9a); text-transform:uppercase; }
.cx-hint{ font-family:'Exo 2',sans-serif; font-style:italic; font-size:11.5px;
  line-height:1.5; color:var(--dim,#7d8f9a); margin:0; }
.cx-meta-card{ border-left:2px solid var(--acid,#39ff14); padding:8px 0 8px 10px; margin:0 0 14px; }
.cx-meta-eyebrow{ font-family:'Space Mono',monospace; font-size:8px; letter-spacing:.18em;
  color:var(--acid,#39ff14); margin-bottom:5px; }
.cx-meta-body{ font-family:'Exo 2',sans-serif; font-size:12px; line-height:1.5;
  color:var(--beige,#dfd2b4); margin:0 0 6px; }
.cx-meta-foot{ font-family:'JetBrains Mono',monospace; font-size:8.5px;
  color:var(--dim,#7d8f9a); letter-spacing:.06em; }
.cx-empty{ padding:34px 30px; max-width:620px; }
.cx-empty h3{ font-family:Orbitron,sans-serif; font-size:14px; letter-spacing:.16em;
  color:var(--amber,#ff9a3c); margin:0 0 12px; }
.cx-empty p{ font-family:'Exo 2',sans-serif; font-size:13px; line-height:1.6;
  color:var(--dim,#7d8f9a); margin:0 0 10px; }
.cx-empty code{ font-family:'JetBrains Mono',monospace; font-size:11.5px; color:var(--cyan); }
@media (max-width:860px){
  .cx-wrap{ grid-template-columns:1fr; height:auto; }
  .cx-index, .cx-meta{ border:0; border-bottom:1px solid var(--line,#1e2a33); }
  .cx-index-list{ display:flex; flex-wrap:wrap; gap:2px; }
  .cx-cat{ width:auto; }
  .cx-stage{ height:56vh; }
}

/* Deep-link highlight — the Myth Console (:8786) links to index.html#card=<slug>.
   Uses the palette tokens via an animated colour property; never hue-rotate. */
.deeplinked{
  animation: deeplink-pulse 2.4s ease-out 2;
  outline: 2px solid var(--cyan);
  outline-offset: 6px;
  border-radius: 4px;
}
@keyframes deeplink-pulse{
  0%,100%{ outline-color: var(--cyan);   box-shadow: 0 0 0 0 transparent; }
  40%    { outline-color: var(--acid);   box-shadow: 0 0 28px -4px var(--acid); }
}
@media (prefers-reduced-motion: reduce){
  .deeplinked{ animation: none; }
}
