/* ==========================================================================
   Heritage Minerals: About and Ventures (the story pages).

   About     The whole seam: a core sample beside the title, and the six
             principles each cut from one mineral, with the reason why:
               Build to Last ............ Platinum (doesn't tarnish)
               Context Over Convention .. Emerald (inclusions are character)
               Deploy, Then Refine ...... Gold (mined first, refined after)
               Own the Stack ............ Tantalite (the component level)
               Scale Through Systems .... Diamond (one unit, repeated)
               Invisible Infrastructure . Quartz (keeps time, unseen)
   Ventures  eduSYMS = emerald (growth), LVMRE = gold (the lab, est. 2005),
             Great Dyke Fintech = platinum (the Great Dyke's metal),
             GHS = quartz (time: rostering and care), BaobabBrain = emerald.
             LVMRE's stack is cut as strata: quartz, gold, platinum, tantalite.

   Layers on pages.css and minerals.css. Linked on about.html and
   ventures.html by scripts/update_minerals.py, which also writes the core
   sample, value lines, hallmarks and platform chips.
   ========================================================================== */

.mn-gild--platinum-ink { --mn-text-lustre: var(--mn-ink-platinum); }
[data-theme="dark"] .mn-gild--platinum-ink { --mn-text-lustre: var(--mn-glow-platinum); }

/* ==========================================================================
   ABOUT
   ========================================================================== */

/* Core sample beside the title: the seam this site is cut from */
.page-header:has(.mn-core) { position: relative; overflow: clip; }
.mn-core {
    position: absolute; z-index: 1; top: 50%; translate: 0 -42%;
    right: max(2rem, calc((100% - 1280px) / 2 + 2rem));
    height: min(330px, 74%); display: grid; grid-template-columns: 44px auto; grid-template-rows: 1fr auto; column-gap: 0.9rem;
    pointer-events: none;
}
.mn-core__tube {
    position: relative; display: flex; flex-direction: column; border-radius: 22px / 9px; overflow: hidden;
    box-shadow: 0 24px 40px -18px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.15);
    animation: mn-core-out 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}
.mn-core__tube::after { /* the cylinder catches light down its length */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.38), rgba(255, 255, 255, 0.4) 32%, rgba(255, 255, 255, 0) 52%, rgba(0, 0, 0, 0.45));
}
.mn-core__band { flex: var(--h) 1 0; display: block; background: var(--s-lustre); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.28); }
.mn-core__band.mn-s--quartz { background: linear-gradient(180deg, #E9E3F4, #CFC6E0); }
.mn-core__band.mn-s--diamond { background: radial-gradient(circle at 40% 40%, #FFFFFF, transparent 40%), conic-gradient(from var(--mn-fire), var(--mn-fire-stops)); animation: mn-fire 9s linear infinite; }
.mn-core__labels { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; }
.mn-core__labels li {
    flex: var(--h) 1 0; display: flex; align-items: center; gap: 0.5rem; white-space: nowrap;
    font: 500 0.72rem/1.1 var(--font-mono, 'JetBrains Mono', monospace); color: var(--color-text-secondary);
    opacity: 0; animation: mn-core-label 0.6s ease calc(0.9s + var(--i) * 0.12s) both;
}
.mn-core__labels li::before { content: ""; width: 12px; height: 1px; background: currentColor; opacity: 0.5; }
.mn-core__labels b { min-width: 2.3em; font-weight: 800; color: var(--s-text); }
.mn-core__cap { grid-column: 1 / -1; margin: 0.8rem 0 0; font: 600 0.6rem/1.3 var(--font-mono, 'JetBrains Mono', monospace); letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-text-tertiary, #ADB5BD); }
@keyframes mn-core-out { from { clip-path: inset(0 0 100% 0 round 22px); } to { clip-path: inset(0 0 0 0 round 22px); } }
@keyframes mn-core-label { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 1099px) { .mn-core { display: none; } }

/* Principles: numerals in the stone, an edge of it, and the reason why */
.values-grid .value-card { --s-c: var(--mn-gold); overflow: hidden; transition: transform 0.35s var(--ease-spring, ease), box-shadow 0.35s; }
.values-grid .value-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--s-lustre); }
.values-grid .value-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg), 0 0 0 1px color-mix(in srgb, var(--s-c) 40%, transparent); }
.values-grid .value-card__number {
    opacity: 1; background-image: var(--s-ink); background-size: 200% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .values-grid .value-card__number { background-image: var(--s-glow); }
.mn-why { display: flex; align-items: flex-start; gap: 0.55rem; margin: 1rem 0 0; padding-top: 0.85rem; border-top: 1px dashed var(--color-border); font-size: 0.8rem; line-height: 1.5; color: var(--color-text-secondary); }
.mn-why .mn-chip { flex: none; margin-top: -0.05rem; }

/* Competencies: six cards, six stones on their top edge */
.competencies__grid .competency-card { border-top: 3px solid var(--s-c, var(--mn-gold)); }
.competencies__grid .competency-card:nth-child(6n+1) { --s-c: var(--mn-gold); }
.competencies__grid .competency-card:nth-child(6n+2) { --s-c: var(--mn-tantalite-hi); }
.competencies__grid .competency-card:nth-child(6n+3) { --s-c: var(--mn-emerald); }
.competencies__grid .competency-card:nth-child(6n+4) { --s-c: var(--mn-platinum-lo); }
.competencies__grid .competency-card:nth-child(6n+5) { --s-c: var(--mn-quartz-lo); }
.competencies__grid .competency-card:nth-child(6n+6) { --s-c: var(--mn-diamond-lo); }

/* ==========================================================================
   VENTURES
   ========================================================================== */

/* Each venture in its stone: title, badge, hallmark on the visual */
#edusyms { --s-ink: var(--mn-ink-emerald); --s-glow: var(--mn-glow-emerald); --s-c: var(--mn-emerald); --s-lustre: var(--mn-lustre-emerald); }
#lvmre { --s-ink: var(--mn-ink-gold); --s-glow: var(--mn-glow-gold); --s-c: var(--mn-gold); --s-lustre: var(--mn-lustre-gold); }
.venture-detail .venture-detail__title .gradient-text { background-image: var(--s-ink); background-size: 220% 100%; }
[data-theme="dark"] .venture-detail .venture-detail__title .gradient-text { background-image: var(--s-glow); }
.venture-detail .venture-detail__badge::before {
    content: ""; display: inline-block; width: 0.75em; height: 0.75em; margin-right: 0.5em; vertical-align: -0.05em; background: var(--s-lustre);
}
#edusyms .venture-detail__badge::before { clip-path: polygon(28% 0, 72% 0, 100% 28%, 100% 72%, 72% 100%, 28% 100%, 0 72%, 0 28%); }
#lvmre .venture-detail__badge::before { border-radius: 46% 54% 42% 58% / 55% 45% 55% 45%; }
#edusyms .stat-mini__number { color: var(--mn-emerald-ink); }
#lvmre .stat-mini__number { color: var(--mn-gold-ink); }
[data-theme="dark"] #edusyms .stat-mini__number { color: var(--mn-emerald-hi); }
[data-theme="dark"] #lvmre .stat-mini__number { color: var(--mn-gold); }
.venture-detail__visual { position: relative; }
.mn-hallmark--venture {
    position: absolute; z-index: 3; top: -14px; right: -10px; width: clamp(92px, 7.5vw, 112px);
    animation: mn-hm-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}
.mn-hallmark--emerald.mn-hallmark--venture { --hm-rim-stroke: rgba(111, 227, 176, 0.55); --hm-dash: rgba(166, 242, 207, 0.35); --hm-text: #A6F2CF; }
.mn-hallmark--gold.mn-hallmark--venture { --hm-rim-stroke: rgba(214, 168, 90, 0.6); --hm-text: #F1D6A0; }
/* eduSYMS hub: the centre stone is an emerald */
#edusyms .ecosystem-hub__center { background: var(--mn-lustre-emerald); color: #04281D; box-shadow: 0 0 0 6px color-mix(in srgb, var(--mn-emerald) 18%, transparent), 0 18px 36px -12px rgba(7, 94, 67, 0.6); }

/* LVMRE's stack, cut as strata: quartz, gold, platinum, tantalite.
   Solid mineral slabs with white text (the old Data layer was grey on grey). */
.tech-stack-visual__layer { position: relative; isolation: isolate; overflow: hidden; color: #FFFFFF; border-left: 4px solid var(--s-c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 22px -14px rgba(0, 0, 0, 0.6); }
.tech-stack-visual__layer small { opacity: 0.88; }
.tech-stack-visual__layer--1 { --s-c: #CFC6E0; background: linear-gradient(135deg, #3B3150, #6D5F8A); }
.tech-stack-visual__layer--2 { --s-c: #F1D6A0; background: linear-gradient(135deg, #5E4210, #A87A28); }
.tech-stack-visual__layer--3 { --s-c: #FFFFFF; background: linear-gradient(135deg, #3F444A, #7A8088); }
.tech-stack-visual__layer--4 { --s-c: #8FA3BE; background: linear-gradient(135deg, #1C1815, #3D4A5E); color: #E6ECF4; }
.tech-stack-visual__layer::after { /* the slab catches the light */
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.14) 48%, transparent 62%);
    background-size: 250% 100%; background-position: 100% 0; transition: background-position 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.tech-stack-visual__layer:hover::after { background-position: 0 0; }

/* Platforms: each carries its stone */
.platform-card { position: relative; overflow: hidden; }
.platform-card:has(.mn-chip)::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--s-lustre); }
.platform-card:has(.mn-s--quartz) { --s-lustre: var(--mn-lustre-quartz); --s-c: var(--mn-quartz-lo); }
.platform-card:has(.mn-s--platinum) { --s-lustre: var(--mn-lustre-platinum); --s-c: var(--mn-platinum-lo); }
.platform-card:has(.mn-s--emerald) { --s-lustre: var(--mn-lustre-emerald); --s-c: var(--mn-emerald); }
.platform-card:has(.mn-chip):hover { box-shadow: var(--shadow-lg), 0 0 0 1px color-mix(in srgb, var(--s-c) 45%, transparent); }
.platform-card__header .mn-chip { margin-left: 0.5rem; vertical-align: middle; }

/* ==========================================================================
   Motion, forced colours, print
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .mn-core__tube, .mn-core__labels li, .mn-core__band.mn-s--diamond, .ventures-num__value, .mn-hallmark--venture { animation: none !important; opacity: 1; }
}
@media (forced-colors: active) {
    .mn-core, .mn-hallmark--venture { display: none; }
    .values-grid .value-card__number, .ventures-num__value { background: none; color: CanvasText; -webkit-text-fill-color: CanvasText; }
}
@media print {
    .mn-core, .mn-hallmark--venture { display: none !important; }
    .ventures-num__value, .values-grid .value-card__number { background: none; color: #000; -webkit-text-fill-color: #000; }
}
