/* ==========================================================================
   Heritage Minerals: the book pages.
   Each book is cut from one mineral, keeping its cover colour:
     Blockages of Work  Gold      refined by fire: blockages burned off as dross
     PROMPT1000+        Diamond   the brilliant cut: 1,200 facets, one clear answer
     ASKTURA            Emerald   the step cut: a ladder of facets, like the method
   (Blockages of Work styles also dress the /books shelf, which shares .bow.)

   Layers on book.css / prompt1000.css / asktura.css and minerals.css.
   Linked only on .bow pages by scripts/update_minerals.py, which also writes
   the hero hallmark (.mn-hallmark) and the shelf's cut chips (.mn-cut).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Per-book mineral tokens (body classes: .bow, .bow.p1k, .bow.p1k.ask)
   -------------------------------------------------------------------------- */
.bow {
    --bk-lustre: linear-gradient(115deg, #C8963F 0%, #F7E3B0 18%, #D6A85A 36%, #FFF3D1 50%, #B98A3A 66%, #F1D6A0 84%, #C8963F 100%);
    --bk-lustre-v: linear-gradient(180deg, #F7E3B0, #D6A85A 40%, #8A6420 75%, #F1D6A0);
    --bk-btn: linear-gradient(115deg, #B98A3A 0%, #F1D6A0 28%, #D6A85A 50%, #F7E3B0 74%, #C8963F 100%);
    --bk-shine: linear-gradient(105deg, transparent 30%, rgba(255, 236, 190, 0.26) 45%, transparent 60%);
    --bk-glyph-clip: none;
    --bk-glyph-radius: 46% 54% 42% 58% / 55% 45% 55% 45%;
    --bk-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600' fill='none' stroke='rgb(214,168,90)' stroke-linecap='round'%3E%3Cpath stroke-width='1.4' stroke-opacity='.55' d='M-20 120C80 90 140 180 230 150S380 60 470 120S600 200 640 160'/%3E%3Cpath stroke-width='.8' stroke-opacity='.4' d='M-20 330C60 300 160 380 260 340S420 260 520 330S610 380 640 360'/%3E%3Cpath stroke-width='1' stroke-opacity='.45' d='M120 620C150 520 230 500 260 420S330 300 300 220'/%3E%3Cpath stroke-width='.7' stroke-opacity='.35' d='M380 620C400 540 470 520 500 450S560 380 620 400'/%3E%3Cpath stroke-width='.6' stroke-opacity='.3' d='M230 150C250 200 240 260 260 340'/%3E%3Cg fill='rgb(241,214,160)' stroke='none' fill-opacity='.55'%3E%3Ccircle cx='230' cy='150' r='3'/%3E%3Ccircle cx='470' cy='120' r='2.2'/%3E%3Ccircle cx='260' cy='340' r='2.6'/%3E%3Ccircle cx='300' cy='222' r='1.8'/%3E%3Ccircle cx='520' cy='330' r='2'/%3E%3Ccircle cx='140' cy='160' r='1.4'/%3E%3C/g%3E%3C/svg%3E");
    --bk-mark-size: min(1100px, 120vw);
    --bk-mark-pos: right -12% top -20%;
}
.p1k {
    --bk-lustre: linear-gradient(115deg, #00C2E0 0%, #A5F3FF 18%, #FFFFFF 30%, #00E5FF 44%, #C6B8FF 54%, #FFE7F3 60%, #A5F3FF 72%, #00E5FF 100%);
    --bk-lustre-v: linear-gradient(180deg, #FFB8B8, #FFE7A3, #C9F7B5, #00E5FF 50%, #C6B8FF, #FFB8E6);
    --bk-btn: linear-gradient(115deg, #00C8EA 0%, #A5F3FF 30%, #00E5FF 55%, #D9FBFF 80%, #00B8D9 100%);
    --bk-shine: linear-gradient(105deg, transparent 30%, rgba(255, 184, 230, 0.16) 41%, rgba(255, 255, 255, 0.3) 46%, rgba(168, 233, 255, 0.2) 51%, transparent 62%);
    --bk-glyph-clip: polygon(50% 100%, 0 38%, 22% 6%, 78% 6%, 100% 38%);
    --bk-glyph-radius: 0;
    --bk-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-100 -100 200 200' fill='none' stroke='rgb(0,229,255)' stroke-width='.45'%3E%3Ccircle r='95' stroke-opacity='.6'/%3E%3Cpath stroke-opacity='.55' d='M95.0 0.0 L38.8 16.1 L67.2 67.2 L16.1 38.8 L0.0 95.0 L-16.1 38.8 L-67.2 67.2 L-38.8 16.1 L-95.0 0.0 L-38.8 -16.1 L-67.2 -67.2 L-16.1 -38.8 L-0.0 -95.0 L16.1 -38.8 L67.2 -67.2 L38.8 -16.1Z'/%3E%3Cpath stroke-opacity='.7' d='M38.8 16.1 L16.1 38.8 L-16.1 38.8 L-38.8 16.1 L-38.8 -16.1 L-16.1 -38.8 L16.1 -38.8 L38.8 -16.1Z'/%3E%3Cpath stroke-opacity='.4' d='M38.8 16.1L87.8 36.4M16.1 38.8L36.4 87.8M-16.1 38.8L-36.4 87.8M-38.8 16.1L-87.8 36.4M-38.8 -16.1L-87.8 -36.4M-16.1 -38.8L-36.4 -87.8M16.1 -38.8L36.4 -87.8M38.8 -16.1L87.8 -36.4'/%3E%3Cpath stroke-opacity='.18' d='M0 0L95.0 0.0M0 0L67.2 67.2M0 0L0.0 95.0M0 0L-67.2 67.2M0 0L-95.0 0.0M0 0L-67.2 -67.2M0 0L-0.0 -95.0M0 0L67.2 -67.2'/%3E%3C/svg%3E");
    --bk-mark-size: min(760px, 95vw);
    --bk-mark-pos: right -14% top -18%;
}
.ask {
    --bk-lustre: linear-gradient(115deg, #00A3B4 0%, #7FEFF7 20%, #3CCB8F 36%, #00CFDF 50%, #A6F2CF 66%, #00CFDF 84%, #00A3B4 100%);
    --bk-lustre-v: linear-gradient(180deg, #7FEFF7, #00CFDF 30%, #1F9D6E 60%, #6FE3B0);
    --bk-btn: linear-gradient(115deg, #00A3B4 0%, #7FEFF7 35%, #00CFDF 60%, #5FE3EE 100%);
    --bk-shine: linear-gradient(105deg, transparent 30%, rgba(166, 242, 207, 0.22) 45%, transparent 60%);
    --bk-glyph-clip: polygon(28% 0, 72% 0, 100% 28%, 100% 72%, 72% 100%, 28% 100%, 0 72%, 0 28%);
    --bk-glyph-radius: 0;
    --bk-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 208 268' fill='none' stroke='rgb(0,207,223)' stroke-width='.7'%3E%3Cpath stroke-opacity='0.60' d='M34.0 0.0 L166.0 0.0 L200.0 34.0 L200.0 226.0 L166.0 260.0 L34.0 260.0 L0.0 226.0 L0.0 34.0Z'/%3E%3Cpath stroke-opacity='0.52' d='M43.3 16.0 L156.7 16.0 L184.0 43.3 L184.0 216.7 L156.7 244.0 L43.3 244.0 L16.0 216.7 L16.0 43.3Z'/%3E%3Cpath stroke-opacity='0.44' d='M52.6 32.0 L147.4 32.0 L168.0 52.6 L168.0 207.4 L147.4 228.0 L52.6 228.0 L32.0 207.4 L32.0 52.6Z'/%3E%3Cpath stroke-opacity='0.36' d='M61.8 48.0 L138.2 48.0 L152.0 61.8 L152.0 198.2 L138.2 212.0 L61.8 212.0 L48.0 198.2 L48.0 61.8Z'/%3E%3Cpath stroke-opacity='0.28' d='M71.1 64.0 L128.9 64.0 L136.0 71.1 L136.0 188.9 L128.9 196.0 L71.1 196.0 L64.0 188.9 L64.0 71.1Z'/%3E%3Cpath stroke-opacity='.3' d='M17 17L64 64M183 17L136 64M183 243L136 196M17 243L64 196'/%3E%3C/svg%3E");
    --bk-mark-size: min(560px, 75vw);
    --bk-mark-pos: right 6% top 50%;
}

/* The Seam replaces the old single-colour reading bar */
.bow-progress { display: none; }

/* --------------------------------------------------------------------------
   2. Hero: the gilded line takes the book's mineral; the mineral's map
      is etched faintly into the background; the hallmark sits on the book.
   -------------------------------------------------------------------------- */
.bow-hero__line--gold {
    background-image: var(--bk-lustre);
    background-size: 240% 100%;
    animation: mn-bk-sheen 10s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
    filter: drop-shadow(0 0 22px rgba(var(--gold-rgb), 0.18));
}
@keyframes mn-bk-sheen { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.bow-hero__bg::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: var(--bk-mark) no-repeat var(--bk-mark-pos) / var(--bk-mark-size);
    opacity: 0.32;
    -webkit-mask-image: radial-gradient(70% 90% at 80% 40%, #000, transparent);
    mask-image: radial-gradient(70% 90% at 80% 40%, #000, transparent);
}
.ask .bow-hero__bg::after { background-position: right 4% center; transform: rotate(-8deg); }

/* Live "out now" light: emerald, the site's growth signal */
.bow-pulse { background: var(--mn-emerald-hi); animation-name: mn-bk-pulse; }
@keyframes mn-bk-pulse { 70% { box-shadow: 0 0 0 10px rgba(111, 227, 176, 0); } 0% { box-shadow: 0 0 0 0 rgba(111, 227, 176, 0.7); } 100% { box-shadow: 0 0 0 0 rgba(111, 227, 176, 0); } }

/* The 3D book's gloss becomes the mineral's light */
.book3d__shine { background-image: var(--bk-shine); }

/* Hallmark: an assay stamp on the hero book, its legend turning slowly */
.bow-hero__stage { position: relative; }
.mn-hallmark {
    /* beside the spine, upper-left, so it never covers a cover title */
    --hm: clamp(84px, 8.5vw, 118px);
    position: absolute; z-index: 3; top: 3%; left: max(0px, calc(50% - clamp(105px, 13vw, 165px) - var(--hm) + 14px));
    width: var(--hm); aspect-ratio: 1; pointer-events: none;
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.5));
    animation: mn-hm-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}
.bow .mn-hallmark { --hm-rim-stroke: rgba(var(--gold-rgb), 0.55); --hm-dash: rgba(var(--gold2-rgb), 0.35); --hm-text: var(--gold-2); }
@media (max-width: 959px) { .mn-hallmark { top: 0; } }

/* --------------------------------------------------------------------------
   3. Buttons: gold bar (Blockages), brilliant with a ring of fire
      (PROMPT1000+), step-cut bevels (ASKTURA). All share a diamond glint.
   -------------------------------------------------------------------------- */
.bow-btn--gold {
    position: relative; isolation: isolate; overflow: hidden;
    background: var(--bk-btn);
}
.bow-btn--gold::after {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 60%; z-index: -1; pointer-events: none;
    background: linear-gradient(105deg, transparent 15%, rgba(255, 231, 243, 0.35) 45%, rgba(255, 255, 255, 0.75) 50%, rgba(168, 233, 255, 0.35) 55%, transparent 80%);
    transform: skewX(-18deg) translateX(-170%);
}
.bow-btn--gold:hover::after, .bow-btn--gold:focus-visible::after { transform: skewX(-18deg) translateX(330%); transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1); }
.p1k:not(.ask) .bow-btn--gold {
    border-color: transparent;
    background: var(--bk-btn) padding-box, conic-gradient(from var(--mn-fire), var(--mn-fire-stops)) border-box;
}
.p1k:not(.ask) .bow-btn--gold:hover { animation: mn-fire 2.4s linear infinite; }
.ask .bow-btn--gold {
    box-shadow: 0 10px 30px -10px rgba(var(--gold-rgb), 0.7),
        inset 0 0 0 2px rgba(255, 255, 255, 0.3), inset 0 0 0 4px rgba(0, 60, 70, 0.12), inset 0 0 0 6px rgba(255, 255, 255, 0.14);
}
.ask .bow-btn--gold:hover {
    box-shadow: 0 18px 40px -12px rgba(var(--gold-rgb), 0.85),
        inset 0 0 0 2px rgba(255, 255, 255, 0.4), inset 0 0 0 4px rgba(0, 60, 70, 0.14), inset 0 0 0 6px rgba(255, 255, 255, 0.2);
}
.bow-btn--ghost:hover { border-color: transparent; background: linear-gradient(var(--navy), var(--navy)) padding-box, var(--bk-lustre) border-box; color: var(--gold-2); }
.bow-section:not(.bow-section--dark) .bow-btn--ghost:hover { background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--bk-lustre) border-box; color: var(--gold-ink); }
.bow-section--alt .bow-btn--ghost:hover { background: linear-gradient(var(--bg-alt), var(--bg-alt)) padding-box, var(--bk-lustre) border-box; }

/* --------------------------------------------------------------------------
   4. Sections: kickers carry a cut stone; pull quotes a mineral edge;
      dark sections carry the book's mineral map; the ticker is a lustre band.
   -------------------------------------------------------------------------- */
.bow-kicker::before {
    content: ""; display: inline-block; width: 0.78em; height: 0.78em; margin-right: 0.6em; vertical-align: -0.06em;
    background: var(--bk-lustre); background-size: 300% 100%; clip-path: var(--bk-glyph-clip); border-radius: var(--bk-glyph-radius);
    box-shadow: 0 0 10px rgba(var(--gold-rgb), 0.45);
}
.bow-pull { border-left-color: transparent; border-image: var(--bk-lustre-v) 1; }
.bow-section--dark { isolation: isolate; }
.bow-section--dark::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: var(--bk-mark) no-repeat var(--bk-mark-pos) / var(--bk-mark-size);
    opacity: 0.22;
    -webkit-mask-image: linear-gradient(100deg, transparent 25%, #000 85%);
    mask-image: linear-gradient(100deg, transparent 25%, #000 85%);
}
.bow-section--dark:nth-of-type(even)::before { background-position: left -14% bottom -20%; transform: scaleX(-1); }
.bow-ticker { background: var(--bk-btn); background-size: 200% 100%; }
.bow:not(.p1k) .bow-ticker__track span::after { content: "\25C6"; }  /* gold: a refined grain between the stalls */
.p1k:not(.ask) .bow-ticker__track span::after { content: "\2727"; }  /* diamond: a sparkle */
.ask .bow-ticker__track span::after { content: "\2B23"; }           /* emerald: the hexagonal crystal */

/* --------------------------------------------------------------------------
   5. /books shelf: each record carries its cut
   -------------------------------------------------------------------------- */
.mn-cut {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.22rem 0.55rem 0.22rem 0.4rem; border-radius: 999px;
    font: 600 0.62rem/1 var(--font-mono, 'JetBrains Mono', monospace); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
    color: var(--mn-cut-ink); background: color-mix(in srgb, var(--mn-cut-c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--mn-cut-c) 40%, transparent);
}
.mn-cut i { width: 0.8rem; height: 0.8rem; background: var(--mn-cut-lustre); }
.mn-cut--gold { --mn-cut-c: #D6A85A; --mn-cut-ink: #F1D6A0; --mn-cut-lustre: var(--mn-lustre-gold); }
.mn-cut--gold i { border-radius: 46% 54% 42% 58% / 55% 45% 55% 45%; }
.mn-cut--diamond { --mn-cut-c: #A5F3FF; --mn-cut-ink: #D9FBFF; --mn-cut-lustre: conic-gradient(from 20deg, var(--mn-fire-stops)); }
.mn-cut--diamond i { clip-path: polygon(50% 100%, 0 38%, 22% 6%, 78% 6%, 100% 38%); }
.mn-cut--emerald { --mn-cut-c: #3CCB8F; --mn-cut-ink: #A6F2CF; --mn-cut-lustre: var(--mn-lustre-emerald); }
.mn-cut--emerald i { clip-path: polygon(28% 0, 72% 0, 100% 28%, 100% 72%, 72% 100%, 28% 100%, 0 72%, 0 28%); }

/* --------------------------------------------------------------------------
   6. Motion, contrast, forced colours, print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .bow-hero__line--gold, .mn-hallmark, .mn-hallmark__ring, .mn-hallmark--diamond::before, .p1k:not(.ask) .bow-btn--gold:hover { animation: none !important; }
    .bow-btn--gold:hover::after { transition: none; }
}
@media (forced-colors: active) {
    .bow-hero__line--gold { background: none; color: CanvasText; filter: none; }
    .mn-hallmark, .bow-hero__bg::after, .bow-section--dark::before, .bow-kicker::before { display: none; }
    .bow-pull { border-image: none; border-left-color: CanvasText; }
}
@media print {
    .mn-hallmark, .bow-hero__bg::after, .bow-section--dark::before { display: none !important; }
}
