/* =========================================================================
   THE AKASHIC LENS — styles
   Akashic, not sci-fi: deep indigo and near-black, warm gold for the
   sacred and the selected, luminous dust. Serif display for names,
   quiet readable text for the rest. Motion is slow and reverent.
   ========================================================================= */

:root {
  --void:        #050810;
  --deep:        #0a1020;
  --indigo:      #101a36;
  --violet:      #5b76c4;
  --violet-dim:  #2c3c6a;
  --gold:        #e8c476;
  --gold-bright: #f6dfa4;
  --gold-dim:    #9a7c46;
  --ink:         #d3dbee;
  --ink-dim:     #8794b8;
  --serif:       Palatino, "Palatino Linotype", "Book Antiqua", "Iowan Old Style", Georgia, serif;
  --text:        Georgia, "Iowan Old Style", "Times New Roman", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  color: var(--ink);
  font-family: var(--text);
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: var(--gold); }

/* =========================================================================
   THE ROOT CONTAINER — the whole instrument is scoped to THIS box, never the
   viewport. Embedded via shortcode it fills whatever height the host page
   gives its <div id="mythica-lens-root">, so it never escapes the page flow
   or collides with a themed site header above it. Every lens layer inside is
   position:absolute against this root (not fixed). Standalone, index.html's
   own <style> gives the root a full-viewport box.
   ========================================================================= */
#mythica-lens-root {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 70% at 50% -10%, #13204a 0%, rgba(27,21,56,0) 60%),
    radial-gradient(ellipse 90% 60% at 50% 115%, #0d1730 0%, rgba(12,18,42,0) 55%),
    linear-gradient(180deg, #071022 0%, #050b18 55%, #030710 100%);
  color: var(--ink);
  font-family: var(--text);
}

/* The instrument is a drag surface: a gesture that begins over chrome text
   (the wordmark took a blue selection highlight live) must not select it.
   Reading surfaces — the risen book, the Librarian's replies, entry cards —
   keep normal text selection below. */
#mythica-lens-root {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#mythica-lens-root #risen,
#mythica-lens-root .oracle-log,
#mythica-lens-root .map-card,
#mythica-lens-root .lib-eyebrow,
#mythica-lens-root .lib-title,
#mythica-lens-root .lib-ex,
#mythica-lens-root .mf-body,
#mythica-lens-root .grove-tip,
/* ⚠ AND HER OWN REPLIES, which were missing from this list for as long as it
   has existed. Peter, 2026-08-20: "I can't drag & copy/paste within her
   responses." She is the most-read text on the surface — she names figures,
   quotes the record, lists what she cannot show — and none of it could be
   taken away. The whole instrument is a drag surface so a gesture over chrome
   pans instead of painting a blue highlight; the allow-list is how reading
   surfaces opt back in, and the one surface people actually read was not on
   it. The whole chatbot is named rather than a reply class, because the
   markup inside it is AI-Engine-versioned and will change under us. */
#mythica-lens-root .mwai-chatbot-container,
#mythica-lens-root .mwai-reply,
#mythica-lens-root .mwai-content {
  -webkit-user-select: text;
  user-select: text;
}

/* ============================== chrome ============================== */

#chrome {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 18px 0;
  pointer-events: none;
}
#chrome > * { pointer-events: auto; }

.wordmark {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.2;
}
.wordmark b {
  display: block;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
}
.wordmark span {
  font-size: 10.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* the lens rail — a quiet vertical column on the right edge */
#switcher {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 42;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 1px solid rgba(125,150,220,0.16);
  border-radius: 999px;
  background: rgba(7,11,26,0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rail-rule {
  width: 16px;
  height: 1px;
  margin: 2px 0;
  background: linear-gradient(90deg, transparent, rgba(135,160,225,0.4), transparent);
}

/* each button is an actual LENS: circular optical glass, rim-lit,
   with the faint refraction of a curved surface — quiet */
.lens-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink-dim);
  background:
    radial-gradient(circle at 32% 26%, rgba(215,228,255,0.18), rgba(150,175,225,0.06) 36%, rgba(8,13,28,0.35) 72%, rgba(6,10,22,0.55) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(165,190,240,0.28),
    inset 0 5px 9px rgba(200,218,255,0.1),
    inset 0 -7px 12px rgba(0,0,0,0.5),
    0 2px 10px rgba(0,0,0,0.45);
  transition: color .35s, box-shadow .35s, text-shadow .35s;
}
/* the specular streak on the glass */
.lens-btn::after {
  content: '';
  position: absolute;
  left: 20%; top: 12%;
  width: 34%; height: 20%;
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(230,240,255,0.35), rgba(230,240,255,0));
  transform: rotate(-24deg);
  pointer-events: none;
}
.lens-btn .lens-glyph { font-size: 14px; line-height: 1; opacity: .85; }
.lens-btn:hover {
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px rgba(185,205,248,0.45),
    inset 0 5px 9px rgba(200,218,255,0.14),
    inset 0 -7px 12px rgba(0,0,0,0.5),
    0 2px 12px rgba(0,0,0,0.5);
}
/* the active lens: a warm golden glint caught in the glass */
.lens-btn.is-active {
  color: var(--gold-bright);
  background:
    radial-gradient(circle at 32% 26%, rgba(215,228,255,0.16), rgba(150,175,225,0.05) 36%, rgba(8,13,28,0.3) 70%),
    radial-gradient(circle at 62% 68%, rgba(238,203,130,0.34), rgba(238,203,130,0.06) 46%, rgba(238,203,130,0) 70%);
  box-shadow:
    inset 0 0 0 1px rgba(232,196,118,0.5),
    inset 0 5px 9px rgba(200,218,255,0.1),
    inset 0 -7px 12px rgba(60,40,10,0.4),
    0 0 20px rgba(232,196,118,0.16);
  text-shadow: 0 0 14px rgba(232,196,118,0.7);
}

/* the name reveals itself on approach */
.lens-flyout {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(125,150,220,0.2);
  background: rgba(8,12,28,0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.lens-btn:hover .lens-flyout, .lens-btn:focus-visible .lens-flyout {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.lens-flyout .lens-label { font-family: var(--serif); font-size: 13px; letter-spacing: .05em; color: var(--ink); }
.lens-flyout .lens-q {
  font-size: 9px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-dim);
}
.lens-flyout kbd {
  font-family: var(--text);
  font-size: 9.5px;
  color: var(--ink-dim);
  border: 1px solid rgba(135,155,205,0.3);
  border-radius: 4px;
  padding: 0 4px;
}

.scope-badge {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(125,150,220,0.16);
  background: rgba(7,11,26,0.55);
  color: var(--ink-dim);
  transition: color .5s, border-color .5s;
}
.scope-badge.scope-quest {
  color: var(--gold);
  border-color: rgba(232,196,118,0.3);
}

/* ============================ stage/hosts =========================== */

#heavens { position: absolute; inset: 0; z-index: 0; pointer-events: none; transition: opacity .8s ease; }
/* character view: when a being is the focus, the heavens settle so it shines through */
#mythica-lens-root.figures-forward #heavens { opacity: .4; }
#stage { position: absolute; inset: 0; z-index: 1; }

.lens-host, #cosmogram {
  position: absolute;
  inset: 0;
  transition: opacity .55s ease, filter .55s ease, transform 1.15s cubic-bezier(.4,0,.3,1);
}

/* =====================================================================
   HOST-PAGE ARMOR. Embedded, the instrument shares the page with theme
   and plugin CSS that styles generic class names (.map-wrap arrived
   painted WHITE by the live site's stack — it's a common map-widget
   class). Re-assert every structural surface, id-scoped + !important,
   so class-level host rules can never repaint the instrument's interior.
   ===================================================================== */
#mythica-lens-root .lens-host,
#mythica-lens-root #cosmogram,
#mythica-lens-root .map-wrap,
#mythica-lens-root .grove-wrap,
#mythica-lens-root .library-wrap,
#mythica-lens-root .oracle-wrap,
#mythica-lens-root .map-canvas,
#mythica-lens-root .field-canvas,
#mythica-lens-root .cosmo-canvas,
#mythica-lens-root .library-canvas,
#mythica-lens-root .grove-svg {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.is-hidden { visibility: hidden; opacity: 0; pointer-events: none; }
.is-measuring { visibility: visible; opacity: 0; pointer-events: none; }
.is-exiting { opacity: 0; filter: blur(7px); pointer-events: none; }
.is-entering { animation: lensIn 1s ease forwards; }

@keyframes lensIn {
  from { opacity: 0; filter: blur(9px); }
  to   { opacity: 1; filter: blur(0); }
}

/* moving INTO the cosmogram's elements */
#cosmogram.cosmo-into-stars.is-exiting { transform: scale(1.7) translateY(28%); }
#cosmogram.cosmo-into-earth.is-exiting { transform: scale(1.7) translateY(-30%); }
#cosmogram.cosmo-into-tree.is-exiting  { transform: scale(2.1); }

#veil {
  position: absolute;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
#veil.is-on { opacity: 1; }

.lens-heading {
  position: absolute;
  top: 74px;
  left: 0; right: 0;
  text-align: center;
  pointer-events: none;
  z-index: 5;
}
.lens-heading h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  text-shadow: 0 0 22px rgba(232,196,118,0.25);
}
.lens-heading p {
  margin-top: 5px;
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-dim);
}

/* ============================ cosmogram ============================= */

/* deep teal breathing into the indigo of space, near-black at the soil */
#cosmogram {
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(10,34,44,0.5) 0%, rgba(10,34,44,0) 62%),
    linear-gradient(180deg, rgba(8,22,32,0.35) 0%, rgba(8,10,26,0) 45%, rgba(3,3,8,0.5) 100%);
}
.cosmo-canvas { position: absolute; inset: 0; display: block; }

.cosmo-caption {
  position: absolute;
  left: 0; right: 0;
  bottom: 26px;
  text-align: center;
  pointer-events: none;
}
.cosmo-caption h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.22em;
  color: var(--gold-bright);
  text-shadow: 0 0 26px rgba(232,196,118,0.3);
}
.cosmo-caption p {
  margin-top: 6px;
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

.cosmo-hint {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 16px;
  border-radius: 12px;
  color: var(--ink-dim);
  opacity: .68;
  transition: opacity .5s, color .5s, text-shadow .5s;
  text-shadow: 0 1px 8px rgba(5,4,12,0.9);
}
.cosmo-hint .hint-verb {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.cosmo-hint .hint-line {
  font-size: 11px;
  font-style: italic;
}
.cosmo-hint:hover, .cosmo-hint.is-hot {
  opacity: 1;
  color: var(--gold-bright);
  text-shadow: 0 0 18px rgba(232,196,118,0.4);
}
.cosmo-hint-stars { top: 12%; right: 7%; }
.cosmo-hint-tree  { top: 40%; left: 50%; transform: translateX(calc(-50% + 190px)); }
.cosmo-hint-earth { bottom: 13%; left: 8%; }

/* ============================ field lens ============================ */

.field-canvas { position: absolute; inset: 0; display: block; touch-action: none; }

/* quiet type-to-find — the field will hold 191 names */
.field-find {
  position: absolute;
  left: 22px;
  top: 86px;
  width: 216px;
  z-index: 8;
}
.field-find input {
  width: 100%;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(150,175,225,0.25);
  background: rgba(6,10,22,0.6);
  color: var(--ink);
  font: italic 12.5px var(--text);
  outline: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.field-find input:focus { border-color: rgba(232,196,118,0.45); }
.field-find input::placeholder { color: rgba(135,148,184,0.6); }
.field-matches {
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid rgba(150,175,225,0.2);
  background: rgba(7,11,26,0.92);
  overflow: hidden;
}
.field-matches button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink);
  transition: background .25s, color .25s;
}
.field-matches button:hover {
  background: rgba(232,196,118,0.09);
  color: var(--gold-bright);
}

/* ======================== map lens (the globe) ====================== */

.map-wrap { position: absolute; inset: 0; }
.map-canvas { position: absolute; inset: 0; display: block; cursor: grab; touch-action: none; }
.map-canvas:active { cursor: grabbing; }

/* the focused episode's card */
.map-card[hidden] { display: none; }
.map-card {
  position: absolute;
  left: 22px;
  top: 128px;
  width: 268px;
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(150,175,225,0.22);
  background: linear-gradient(180deg, rgba(13,20,46,0.92), rgba(7,11,26,0.94));
  box-shadow: 0 12px 38px rgba(0,0,0,0.5);
  z-index: 6;
}
.map-card-img {
  flex: none;
  width: 72px; height: 72px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(232,196,118,0.3);
}
.map-card-img img, .map-card-img canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-card-body h3 { font-family: var(--serif); font-weight: 400; font-size: 15px; color: var(--gold-bright); }
.map-card-body em { display: block; font-size: 10px; color: var(--ink-dim); margin: 2px 0 4px; }
.map-card-body p { font-size: 11px; line-height: 1.5; color: var(--ink); max-height: 50px; overflow: hidden; }
.map-card-read { font-size: 10.5px; letter-spacing: .12em; text-decoration: none; display: inline-block; margin-top: 4px; }

/* the filmstrip: the quest in time, along the bottom of the world */
.map-strip {
  position: absolute;
  left: 190px;
  right: 84px;
  bottom: 14px;
  display: flex;
  gap: 6px;
  padding: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  border-radius: 12px;
  border: 1px solid rgba(150,175,225,0.16);
  background: rgba(6,10,22,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 6;
}
.map-f {
  flex: none;
  width: 62px;
  height: 42px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  opacity: .55;
  border: 1px solid rgba(150,175,225,0.2);
  background: radial-gradient(circle at 50% 60%, rgba(90,118,196,0.25), rgba(8,13,30,0.9));
  transition: opacity .3s, border-color .3s, transform .3s;
}
.map-f img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-f:hover { opacity: .9; }
.map-f.is-on {
  opacity: 1;
  border-color: rgba(238,203,130,0.85);
  box-shadow: 0 0 12px rgba(232,196,118,0.35);
  transform: translateY(-2px);
}
.map-f.is-blank::after {
  content: '\2726';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(198,214,248,0.5);
  font-size: 12px;
}
.map-f.is-unplaced { border-style: dashed; }

/* chrome adapts around the strip */
body[data-lens="map"] #ribbon { bottom: 84px; }
body[data-lens="map"] #librarian-dock { bottom: 84px; }

/* ============================ grove lens ============================ */

.grove-wrap { position: absolute; inset: 0; }
.grove-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.grove-arc-name {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  fill: rgba(132,146,182,0.6);
}

/* the arboreal frame: trunk-and-bough light carrying the clusters */
.grove-bough { fill: none; }
.grove-bough-glow { stroke: rgba(212,168,92,0.08); stroke-width: 9; stroke-linecap: round; }
.grove-bough-core { stroke: rgba(240,213,150,0.28); stroke-width: 1.4; stroke-linecap: round; }

/* the edges ARE the point: what two stories share, made visible */
.grove-edge {
  fill: none;
  stroke-width: 1.3;
  transition: opacity .7s, stroke .7s;
}
.grove-edge-figure { stroke: rgba(216,182,116,0.5); }
.grove-edge-place  { stroke: rgba(150,172,235,0.48); }
.grove-edge-arc    { stroke: rgba(135,160,225,0.2); }
.grove-edge.is-lit {
  stroke: rgba(238,206,138,0.75);
  stroke-width: 1.6;
  filter: drop-shadow(0 0 4px rgba(232,196,118,0.5));
}
.grove-edge.is-veiled { opacity: .16; }

.grove-node { cursor: pointer; transition: opacity .7s; }
.grove-node.is-veiled { opacity: .2; }
.leaf-core {
  fill: #e9ddb8;
  stroke: rgba(246,223,164,0.5);
  stroke-width: .8;
  transition: r .4s;
}
.grove-node:hover .leaf-core { fill: var(--gold-bright); }
.grove-node.is-lit .leaf-core {
  fill: var(--gold-bright);
  filter: drop-shadow(0 0 8px rgba(232,196,118,0.9));
}
.grove-node.is-lit .leaf-halo { opacity: 1; }
.leaf-title {
  font-family: var(--serif);
  font-size: 11px;
  fill: rgba(205,215,238,0.8);
  pointer-events: none;
}
.grove-node.is-lit .leaf-title { fill: var(--gold-bright); }

.grove-tip {
  position: absolute;
  transform: translate(-50%, -100%);
  max-width: 280px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(232,196,118,0.22);
  background: rgba(8,13,30,0.92);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  z-index: 10;
}
.grove-tip.is-on { opacity: 1; }
.grove-tip strong { font-family: var(--serif); font-weight: 400; color: var(--gold-bright); display: block; font-size: 14px; }
.grove-tip em { display: block; font-size: 11px; color: var(--ink-dim); margin: 3px 0 6px; }
.grove-tip span { font-size: 12px; line-height: 1.55; color: var(--ink); display: block; }
.grove-tip .tip-read { display: block; margin-top: 7px; font-size: 10.5px; letter-spacing: .14em; font-style: normal; color: var(--gold); }

/* figure blossoms — the beings flowering on the boughs */
.grove-blossom { cursor: pointer; transition: opacity .6s; }
.grove-blossom.is-veiled { opacity: .16; }
.blossom-core {
  fill: rgba(200,212,246,0.75);
  stroke: rgba(150,175,225,0.5);
  stroke-width: .7;
  transition: fill .4s;
}
.grove-blossom:hover .blossom-core { fill: var(--gold-bright); }
.grove-blossom.is-lit .blossom-core {
  fill: var(--gold-bright);
  filter: drop-shadow(0 0 6px rgba(232,196,118,0.85));
}
.blossom-name {
  font-family: var(--serif);
  font-size: 9.5px;
  fill: rgba(205,215,238,0.85);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.grove-blossom:hover .blossom-name, .grove-blossom.is-lit .blossom-name { opacity: 1; }

/* participation twigs: a being's branches to their stories */
.grove-part-edge {
  fill: none;
  stroke: rgba(238,206,138,0.5);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  filter: drop-shadow(0 0 3px rgba(232,196,118,0.4));
}

/* the quiet filter affordance */
.grove-filter {
  position: absolute;
  left: 22px;
  top: 86px;
  z-index: 8;
  display: flex;
  gap: 6px;
  align-items: center;
}
.grove-filter select {
  appearance: none;
  -webkit-appearance: none;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(150,175,225,0.25);
  background: rgba(6,10,22,0.6);
  color: var(--ink-dim);
  font: italic 11.5px var(--text);
  outline: none;
  cursor: pointer;
}
.grove-filter select:focus, .grove-filter select:hover { border-color: rgba(232,196,118,0.4); color: var(--ink); }
.grove-clear {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(150,175,225,0.25);
  color: var(--ink-dim);
  font-size: 10px;
}
.grove-clear:hover { color: var(--gold-bright); border-color: rgba(232,196,118,0.4); }

/* the grove floor: living earth at the root of the boughs */
.grove-wrap::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 16%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(43,33,20,0) 0%, rgba(43,33,20,0.4) 55%, rgba(22,16,8,0.75) 100%);
}

/* ==================== library lens (the constellation) =============== */

.library-wrap { position: absolute; inset: 0; }
.library-canvas { position: absolute; inset: 0; display: block; cursor: grab; touch-action: none; outline: none; }
.library-canvas.is-over { cursor: pointer; }
.library-canvas:active { cursor: grabbing; }

.lib-note {
  max-width: 34em;
}

/* the focused entry's card */
.library-card[hidden] { display: none; }
.library-card {
  position: absolute;
  left: 22px;
  top: 128px;
  width: 280px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(150,175,225,0.22);
  background: linear-gradient(180deg, rgba(13,20,46,0.92), rgba(7,11,26,0.94));
  box-shadow: 0 12px 38px rgba(0,0,0,0.5);
  z-index: 6;
}
.lib-eyebrow[hidden] { display: none; }
.lib-eyebrow {
  display: block;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-dim);
  font-style: normal;
  margin-bottom: 4px;
}
.lib-title {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--gold-bright);
  text-decoration: none;
  display: block;
}
.lib-title:hover { text-decoration: underline; }
.lib-ex { font-size: 12px; line-height: 1.6; color: var(--ink); margin: 6px 0 8px; }
.lib-read { font-size: 10.5px; letter-spacing: .12em; text-decoration: none; }

/* the transport, centred above the strip */
.library-transport {
  position: absolute;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(150,175,225,0.18);
  background: rgba(6,10,22,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 6;
}
.library-transport button {
  width: 26px; height: 26px;
  border-radius: 50%;
  color: var(--ink-dim);
  font-size: 16px;
  line-height: 1;
}
.library-transport button:hover { color: var(--gold-bright); }
.lib-count { font-size: 10px; letter-spacing: .14em; color: var(--ink-dim); min-width: 62px; text-align: center; }

/* the filmstrip of entry thumbnails, along the bottom */
.library-strip {
  position: absolute;
  left: 190px;
  right: 84px;
  bottom: 14px;
  display: flex;
  gap: 6px;
  padding: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  border-radius: 12px;
  border: 1px solid rgba(150,175,225,0.16);
  background: rgba(6,10,22,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 6;
}
.library-cell {
  flex: none;
  width: 62px;
  height: 42px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  opacity: .55;
  border: 1px solid rgba(150,175,225,0.2);
  background: radial-gradient(circle at 50% 60%, rgba(90,118,196,0.25), rgba(8,13,30,0.9));
  transition: opacity .3s, border-color .3s, transform .3s;
}
.library-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.library-cell:hover { opacity: .9; }
.library-cell.is-on {
  opacity: 1;
  border-color: rgba(238,203,130,0.85);
  box-shadow: 0 0 12px rgba(232,196,118,0.35);
  transform: translateY(-2px);
}
.library-cell.is-blank::after {
  content: '\2766';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(198,214,248,0.5);
  font-size: 13px;
}

/* chrome adapts around the strip, as on the Map */
body[data-lens="library"] #ribbon { bottom: 84px; }
body[data-lens="library"] #librarian-dock { bottom: 84px; }

/* ============================ oracle lens =========================== */

.oracle-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  padding-top: 64px;
}

.oracle-side {
  width: min(360px, 88vw);
  flex: none;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(125,150,220,0.14);
  background: linear-gradient(180deg, rgba(10,17,40,0.7), rgba(9,7,20,0.85));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.oracle-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(125,150,220,0.12);
}
.oracle-sigil {
  font-size: 22px;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(232,196,118,0.6);
  animation: sigilBreathe 5s ease-in-out infinite;
}
@keyframes sigilBreathe {
  0%, 100% { text-shadow: 0 0 10px rgba(232,196,118,0.4); opacity: .85; }
  50%      { text-shadow: 0 0 24px rgba(232,196,118,0.8); opacity: 1; }
}
.oracle-head h2 { font-family: var(--serif); font-weight: 400; font-size: 17px; letter-spacing: .1em; color: var(--gold-bright); }
.oracle-head p { font-size: 10.5px; font-style: italic; color: var(--ink-dim); }

.oracle-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.oracle-msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  animation: msgIn .5s ease both;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }
.oracle-msg-librarian {
  align-self: flex-start;
  background: rgba(90,115,185,0.13);
  border: 1px solid rgba(135,160,225,0.16);
  border-top-left-radius: 3px;
  color: var(--ink);
}
.oracle-msg-visitor {
  align-self: flex-end;
  background: rgba(232,196,118,0.09);
  border: 1px solid rgba(232,196,118,0.2);
  border-top-right-radius: 3px;
  color: var(--gold-bright);
  font-style: italic;
}
.oracle-typing { display: flex; gap: 4px; padding: 13px 15px; }
.oracle-typing span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--violet);
  animation: tdot 1.1s ease-in-out infinite;
}
.oracle-typing span:nth-child(2) { animation-delay: .18s; }
.oracle-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes tdot { 0%,100% { opacity: .25; transform: translateY(0);} 50% { opacity: 1; transform: translateY(-3px);} }

.oracle-chips { padding: 4px 16px 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.oracle-chip {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(232,196,118,0.3);
  color: var(--gold);
  font-size: 12px;
  font-style: italic;
  background: rgba(232,196,118,0.05);
  transition: background .35s, box-shadow .35s;
  animation: msgIn .6s ease both;
}
.oracle-chip:hover {
  background: rgba(232,196,118,0.13);
  box-shadow: 0 0 16px rgba(232,196,118,0.15);
}
.oracle-done { font-size: 11px; font-style: italic; color: var(--ink-dim); padding: 4px 2px; }

.oracle-form {
  display: flex;
  gap: 8px;
  padding: 10px 16px 16px;
}
.oracle-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(125,150,220,0.25);
  background: rgba(8,6,18,0.7);
  color: var(--ink);
  font: italic 13px var(--text);
  outline: none;
}
.oracle-input:focus { border-color: rgba(232,196,118,0.45); }
.oracle-input::placeholder { color: rgba(132,146,182,0.55); }
.oracle-send { color: var(--gold); font-size: 16px; padding: 0 6px; }

.oracle-stage { position: relative; flex: 1; overflow: hidden; }
.oracle-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.oracle-empty {
  position: absolute;
  top: 46%;
  left: 0; right: 0;
  text-align: center;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-dim);
  opacity: .7;
  transition: opacity .6s;
  pointer-events: none;
}
.oracle-empty.is-off { opacity: 0; }

.o-edge {
  fill: none;
  stroke: rgba(232,196,118,0.45);
  stroke-width: 1.2;
  filter: drop-shadow(0 0 4px rgba(232,196,118,0.35));
  transition: stroke-dashoffset 1.4s ease;
}
.o-edge-label {
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
  fill: rgba(232,196,118,0.85);
  opacity: 0;
  transition: opacity .8s;
}
.o-edge-label.is-in { opacity: 1; }

/* ---- the slot pool: bounded regions that fill and empty; never created
        at runtime. Dormant sockets rest as faint motes in the field. ---- */
.o-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 250px;
  transition: opacity .8s ease, filter .8s ease;
}
.o-slot.is-dormant { pointer-events: none; }
.o-slot.is-dormant::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 5px; height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: rgba(160,182,238,0.35);
  box-shadow: 0 0 12px rgba(135,160,225,0.4);
  animation: socketBreathe 6s ease-in-out infinite;
}
@keyframes socketBreathe {
  0%, 100% { opacity: .35; transform: scale(1); }
  50%      { opacity: .8; transform: scale(1.5); }
}
.o-slot .mf-frame {
  opacity: 0;
  transform: translateY(26px) scale(.95);
  transition: opacity .9s ease, transform .9s cubic-bezier(.25,.8,.3,1);
}
.o-slot.is-filled .mf-frame { opacity: 1; transform: translateY(0) scale(1); }
.o-slot.is-dissolving { opacity: 0; filter: blur(4px); pointer-events: none; }
.o-slot.is-lit .mf-frame {
  border-color: rgba(232,196,118,0.55);
  box-shadow: 0 14px 44px rgba(0,0,0,0.55), 0 0 26px rgba(232,196,118,0.3);
}

/* ============== the frame primitive (one compositor, any host) ========= */
/* Treatment is DERIVED from the entity (the aka reading) and arrives as
   CSS variables: --mf-glow (aura color+alpha), --mf-border, --mf-fog. */

.mf-frame {
  position: relative;
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--mf-border, rgba(125,150,220,0.22));
  background: linear-gradient(180deg, rgba(13,20,46,0.94), rgba(8,12,28,0.96));
  box-shadow: 0 14px 44px rgba(0,0,0,0.55),
              0 0 30px var(--mf-glow, rgba(140,120,210,0.12));
  overflow: hidden;
  transition: box-shadow .5s, border-color .5s;
}
.mf-frame.is-actionable { cursor: pointer; }
/* the fog of the unwritten — depth will drive this when the entity model
   carries metaphysical attributes */
.mf-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(9,14,32,0) 40%,
    rgba(9,14,32,0.9) 130%);
  opacity: var(--mf-fog, 0.2);
}

.mf-figure { text-align: center; padding: 18px 16px 14px; }
.mf-portrait {
  position: relative;
  width: 92px; height: 92px;
  margin: 0 auto 10px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(232,196,118,0.35), 0 0 26px var(--mf-glow, rgba(90,115,185,0.5));
}
.mf-portrait canvas, .mf-portrait img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.mf-portrait img { opacity: 0; transition: opacity 1.2s; }
.mf-portrait img.is-in { opacity: 1; }

.mf-banner { display: block; width: 100%; height: 58px; }

.mf-body { padding: 4px 16px 12px; }
.mf-figure .mf-body { padding: 0; }
.mf-body h3 { font-family: var(--serif); font-weight: 400; font-size: 16.5px; color: var(--gold-bright); letter-spacing: .03em; }
.mf-body em { display: block; font-size: 10.5px; color: var(--ink-dim); margin: 3px 0 6px; }
.mf-body p { font-size: 12px; line-height: 1.6; color: var(--ink); }
.mf-body a { position: relative; z-index: 1; font-size: 11.5px; display: inline-block; margin-top: 8px; text-decoration: none; border-bottom: 1px solid rgba(232,196,118,0.35); }
.mf-episode .mf-body { padding: 10px 16px 14px; }

.mf-rise {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--gold);
  opacity: .75;
}
.mf-rise:hover { opacity: 1; text-shadow: 0 0 10px rgba(232,196,118,0.5); }

/* the cosmogram's panel — second host of the frame primitive */
.cosmo-panel {
  position: absolute;
  right: 86px;
  bottom: 24px;
  width: 236px;
  z-index: 6;
}
.cosmo-panel .panel-caption {
  display: block;
  margin-bottom: 6px;
  font-size: 9.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
@media (max-width: 1100px) { .cosmo-panel { display: none; } }

/* ====================== timeline scrubber (shell) ==================== */
/* One instrument of time under every lens that reads it. Quiet pill,
   golden thumb — the year is the loudest thing on it. */

#timescrub {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 38;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(125,150,220,0.16);
  background: rgba(7,11,26,0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#timescrub[hidden] { display: none; }
#timescrub .ts-play {
  width: 26px;
  height: 26px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 10px;
  color: var(--gold);
  border: 1px solid rgba(232,196,118,0.35);
  transition: box-shadow .3s, border-color .3s;
}
#timescrub .ts-play:hover {
  border-color: rgba(232,196,118,0.7);
  box-shadow: 0 0 14px rgba(232,196,118,0.2);
}
#timescrub .ts-edge {
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--ink-dim);
}
#timescrub .ts-now {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--gold-bright);
  min-width: 90px;
  text-align: center;
  white-space: nowrap;
}
#timescrub .ts-range {
  -webkit-appearance: none;
  appearance: none;
  width: clamp(140px, 26vw, 340px);
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(135,160,225,0.35), rgba(232,196,118,0.45));
  outline: none;
  cursor: pointer;
}
#timescrub .ts-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f6e2ac, #d9ab5c 70%);
  box-shadow: 0 0 10px rgba(232,196,118,0.55);
  border: 1px solid rgba(60,40,10,0.5);
}
#timescrub .ts-range::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f6e2ac, #d9ab5c 70%);
  box-shadow: 0 0 10px rgba(232,196,118,0.55);
  border: 1px solid rgba(60,40,10,0.5);
}

/* the map's filmstrip owns the bottom edge there — ride above it */
body[data-lens="map"] #timescrub { bottom: 76px; }

@media (max-width: 860px) {
  /* the rail is a bottom strip on small screens — sit above it */
  #timescrub { bottom: 72px; padding: 6px 12px; gap: 7px; }
  #timescrub .ts-now { min-width: 74px; font-size: 11px; }
  #timescrub .ts-edge { display: none; }
  body[data-lens="map"] #timescrub { bottom: 128px; }
}

/* ======================== librarian dock (shell) ===================== */

#librarian-dock {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 15px 9px 11px;
  border-radius: 999px;
  border: 1px solid rgba(125,150,220,0.18);
  background: rgba(7,11,26,0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity .5s, border-color .4s, box-shadow .4s;
}
#librarian-dock:hover {
  border-color: rgba(232,196,118,0.4);
  box-shadow: 0 0 22px rgba(232,196,118,0.12);
}
#librarian-dock.is-off { opacity: 0; pointer-events: none; }
#librarian-dock .dock-sigil {
  font-size: 17px;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(232,196,118,0.55);
  animation: sigilBreathe 5s ease-in-out infinite;
}
#librarian-dock .dock-text { text-align: left; }
#librarian-dock .dock-text b {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ink);
}
#librarian-dock .dock-text i {
  display: block;
  font-size: 10px;
  color: var(--ink-dim);
}

/* ========================= risen figure panel ======================== */

#risen-backdrop {
  position: absolute;
  inset: 0;
  z-index: 48;
  background: radial-gradient(ellipse at 30% 45%, rgba(4,3,10,0.25), rgba(4,3,10,0.78));
  opacity: 0;
  pointer-events: none;
  transition: opacity .7s;
}
#risen-backdrop.is-on { opacity: 1; pointer-events: auto; }

#risen {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  z-index: 50;
  width: min(480px, 94vw);
  overflow-y: auto;
  padding: 74px 40px 44px;
  background: linear-gradient(200deg, rgba(16,26,58,0.97) 0%, rgba(8,13,30,0.98) 60%);
  border-left: 1px solid rgba(232,196,118,0.18);
  box-shadow: -30px 0 80px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.22,.8,.3,1);
}
#risen.is-on { opacity: 1; transform: translateY(0); }

.risen-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(135,160,225,0.3);
  color: var(--ink-dim);
  font-size: 13px;
  transition: color .3s, border-color .3s;
}
.risen-close:hover { color: var(--gold-bright); border-color: rgba(232,196,118,0.5); }

#risen-portrait {
  position: relative;
  width: 168px; height: 168px;
  margin: 6px auto 20px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(232,196,118,0.4),
    0 0 0 7px rgba(232,196,118,0.06),
    0 0 60px rgba(232,196,118,0.22),
    0 0 120px rgba(90,115,185,0.3);
  animation: portraitRise 1s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes portraitRise {
  from { transform: translateY(46px) scale(.6); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.portrait-art {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.portrait-photo { opacity: 0; transition: opacity 1.4s ease; }
.portrait-photo.is-in { opacity: 1; }

#risen-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  text-align: center;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(232,196,118,0.35);
}
#risen-role {
  margin-top: 6px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-dim);
}
#risen-bio {
  margin: 20px 0 4px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink);
}
#risen-bio.is-empty { font-style: italic; color: var(--ink-dim); text-align: center; }

.risen-rule {
  margin: 24px auto;
  width: 120px;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,196,118,0.5), transparent);
}

#risen-epcount {
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-align: center;
  margin-bottom: 14px;
}
#risen-episodes { list-style: none; }
#risen-episodes li + li { margin-top: 3px; }
#risen-episodes a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: background .35s;
}
#risen-episodes a:hover { background: rgba(232,196,118,0.07); }
#risen-episodes .ep-title {
  display: block;
  font-family: var(--serif);
  font-size: 15.5px;
  color: var(--gold);
}
#risen-episodes a:hover .ep-title { color: var(--gold-bright); }
#risen-episodes .ep-meta {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-style: italic;
  color: var(--ink-dim);
}
#risen-episodes .ep-read {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--gold-dim);
  opacity: 0;
  transition: opacity .3s;
}
#risen-episodes a:hover .ep-read { opacity: 1; }

#risen-archive {
  display: block;
  margin-top: 26px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold-dim);
  transition: color .3s;
}
#risen-archive:hover { color: var(--gold-bright); }

/* ============================ follow ribbon ========================== */

#ribbon {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translate(-50%, 70px);
  z-index: 44;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 8px;
  border-radius: 999px;
  border: 1px solid rgba(232,196,118,0.28);
  background: rgba(8,13,30,0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.45), 0 0 24px rgba(232,196,118,0.08);
  opacity: 0;
  transition: opacity .6s, transform .6s cubic-bezier(.2,.8,.3,1);
}
#ribbon.is-on { opacity: 1; transform: translate(-50%, 0); }
#ribbon-mini { width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(232,196,118,0.35); }
#ribbon .ribbon-text { font-size: 12px; color: var(--ink-dim); font-style: italic; }
#ribbon .ribbon-text b { font-family: var(--serif); font-weight: 400; font-style: normal; color: var(--gold-bright); letter-spacing: .04em; }
#ribbon button {
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--ink-dim);
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(135,160,225,0.25);
  transition: color .3s, border-color .3s;
}
#ribbon button:hover { color: var(--gold-bright); border-color: rgba(232,196,118,0.4); }

/* ============================= responsive ============================ */

@media (max-width: 860px) {
  /* the rail adapts: a slim strip along the bottom edge */
  #switcher {
    top: auto;
    right: 50%;
    bottom: 12px;
    transform: translateX(50%);
    flex-direction: row;
    padding: 6px 10px;
  }
  .rail-rule { width: 1px; height: 16px; margin: 0 2px; }
  .lens-flyout {
    right: auto;
    top: auto;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translate(-50%, 6px);
  }
  .lens-btn:hover .lens-flyout, .lens-btn:focus-visible .lens-flyout {
    transform: translate(-50%, 0);
  }
  #ribbon { bottom: 70px; }
  #librarian-dock { bottom: 70px; }
  .scope-badge { display: none; }
  .cosmo-hint-tree { transform: translateX(calc(-50% + 120px)); }
  .oracle-wrap { flex-direction: column; }
  .oracle-side {
    width: 100%;
    order: 2;
    height: 46%;
    border-right: none;
    border-top: 1px solid rgba(125,150,220,0.14);
  }
  .oracle-stage { order: 1; }
  .o-frame { width: 200px; }
  #risen { padding: 64px 26px 36px; }
  #librarian-dock .dock-text i { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01s !important; transition-duration: .01s !important; }
}

/* ============================ media faces (v1.11.0) ========================
   The compositor draws image / video / paged-story (flipbook) faces, not just
   figure/episode cards. An episode's "Read →" unbinds the story INTO its frame. */
.mf-frame.mf-expanded {
  z-index: 20;
  transform: scale(1.14);
  box-shadow: 0 22px 60px rgba(0,0,0,.55), 0 0 30px rgba(240,212,147,.16);
}
.mf-media { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; }

/* image face */
.mf-image { margin: 0; flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; }
.mf-image img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transition: opacity .5s ease;
}
.mf-image img.is-in { opacity: 1; }
.mf-image figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px;
  font: italic 12px/1.4 "Palatino Linotype", Palatino, Georgia, serif; color: #eef2ff;
  background: linear-gradient(0deg, rgba(7,11,26,.85), rgba(7,11,26,0));
}

/* video face */
.mf-video {
  flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden;
  background: #0b1126 center/cover no-repeat; display: grid; place-items: center;
}
.mf-video-play {
  width: 54px; height: 54px; border-radius: 50%; cursor: pointer;
  background: rgba(14,20,44,.72); border: 1px solid rgba(238,199,122,.5);
  color: #f2d79a; font-size: 20px; display: grid; place-items: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
}
.mf-video-play:hover { background: rgba(30,40,74,.85); }
.mf-video-title {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px;
  font: 12px/1.4 "Palatino Linotype", Palatino, Georgia, serif; color: #eef2ff;
  background: linear-gradient(0deg, rgba(7,11,26,.85), rgba(7,11,26,0));
}
.mf-video-el { width: 100%; height: 100%; object-fit: contain; background: #05070f; }

/* flipbook face */
.mf-media-flipbook { padding: 0; }
.mf-flip-loading { padding: 22px 16px; font: italic 13px/1.5 Georgia, serif; color: rgba(214,221,244,.7); text-align: center; }
.mf-flip-loading a { color: #e8c47a; }
.mf-flip-cover { height: 74px; background-size: cover; background-position: center; border-bottom: 1px solid rgba(240,212,147,.18); flex: none; }
.mf-flip-title {
  flex: none; padding: 9px 14px 4px; font: 16px/1.15 "Palatino Linotype", Palatino, Georgia, serif; color: #eef2ff;
}
.mf-flip-page {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 14px 8px;
  font: 13.5px/1.62 "Palatino Linotype", Palatino, Georgia, serif; color: #d6ddf4;
  scrollbar-width: thin; scrollbar-color: rgba(240,212,147,.3) transparent;
}
.mf-flip-page p { margin: 0 0 .8em; }
.mf-flip-page p:first-child::first-letter { font-size: 2.4em; line-height: .8; float: left; padding: 3px 7px 0 0; color: #e8c47a; }
.mf-flip-nav {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px 10px; border-top: 1px solid rgba(140,170,235,.12);
}
.mf-flip-nav button { background: none; border: none; color: #e8c47a; font-size: 20px; cursor: pointer; padding: 0 8px; }
.mf-flip-nav button:disabled { opacity: .25; cursor: default; }
.mf-flip-count { font: 10.5px/1 "Palatino Linotype", Palatino, Georgia, serif; letter-spacing: .12em; color: rgba(214,221,244,.6); }
.mf-flip-back {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(14,20,44,.75); border: 1px solid rgba(238,199,122,.3); color: #e6ddc4; font-size: 12px; cursor: pointer;
}
.mf-flip-back:hover { background: rgba(30,40,74,.9); }
