/* ujima.shop home prism overlay — styles
 * Palette and geometry from ~/Downloads/Ujima_Reimagined_Prism_2026-09-23.html:
 * ink #0c0b0a, cream #f2ece1, brass #c9a227, 340ms/950ms wipes, letter-spaced caps.
 * Everything is fixed-position inside #prism; nothing here touches the page under it.
 */
html.prism-lock body { overflow: hidden }

#prism { position: fixed; inset: 0; z-index: 999; opacity: 0; transition: opacity .45s ease;
  /* the stage div never takes a hit - only the facets do, so elementFromPoint inside
     the cut-away region reports the facet that OWNS that wedge, or the page below */
  pointer-events: none }
#prism.on { pointer-events: auto }
#prism.closing, #prism.gone { pointer-events: none }
#prism.on { opacity: 1 }
#prism.gone { display: none }
#prism.closing { opacity: 0 }

#prism .prism-scrim {
  position: absolute; inset: 0; background: #0c0b0a; opacity: .34; pointer-events: none
}

/* ── facets ────────────────────────────────────────────────
   clip-path clips the PAINT only, not the hit area, so a facet that has been cut
   away would still eat every click. The fix is geometric: the facet that is not the
   one under the pointer gets pointer-events:none, and the geometry that decides
   "which one is under the pointer" is facetAt() in home-overlay.js — the SAME two
   edges the clip-path uses. Never leave a painted-away facet clickable.          */
#prism .prism-facet {
  position: absolute; inset: 0; display: block; text-decoration: none;
  background-size: cover; background-position: center; background-color: #0c0b0a;
  overflow: hidden; pointer-events: none;
  transition: clip-path .95s cubic-bezier(.76, 0, .24, 1), filter .5s ease, opacity .6s ease;
  will-change: clip-path
}
#prism .prism-facet::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(12, 11, 10, .18) 0%, rgba(12, 11, 10, .06) 40%, rgba(12, 11, 10, .62) 100%);
  transition: background .5s ease
}
#prism .prism-f0 { clip-path: polygon(0 0, 100% 0, 100% 44%, 0 58%) }
#prism .prism-f1 { clip-path: polygon(0 58%, 50% 51%, 44% 100%, 0 100%) }
#prism .prism-f2 { clip-path: polygon(50% 51%, 100% 44%, 100% 100%, 44% 100%) }
/* the facet under the pointer is the ONLY one that takes clicks */
/* pointer-events lives on its OWN rule. It used to live on the same declaration as
   .prism-facet.hot — and the page's own sheet ends with a `@media (prefers-reduced-
   motion:reduce){*{transition:none}}` universal rule; more importantly the site loads
   AFTER us in some builds, so a single shorthand rule lost the cascade and EVERY facet
   kept pointer-events:none: the overlay looked perfect and no click did anything.
   Keeping this in one place means one thing has to be right. */
#prism .prism-facet.hot,
#prism .prism-facet:focus-visible,
#prism .prism-facet:hover { pointer-events: auto }
#prism .prism-facet:focus-visible { outline: 3px solid #c9a227; outline-offset: -3px }
#prism .prism-facet.hot::after { background: linear-gradient(180deg, rgba(12, 11, 10, .10) 0%, rgba(12, 11, 10, 0) 45%, rgba(12, 11, 10, .70) 100%) }
#prism .prism-facet.hot { filter: saturate(1.08) brightness(1.04) }

/* wipe: the chosen facet expands to the whole stage, the others collapse away */
#prism.open .prism-facet { pointer-events: none }
#prism.open .prism-f0 { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%) }
#prism.open .prism-f1 { clip-path: polygon(0 58%, 50% 51%, 44% 100%, 0 100%); opacity: .25 }
#prism.open .prism-f2 { clip-path: polygon(50% 51%, 100% 44%, 100% 100%, 44% 100%); opacity: .25 }
#prism.open .prism-facet.sel { opacity: 1 }
#prism.open .prism-facet:not(.sel) { opacity: 0 }

/* ── captions ─────────────────────────────────────────────── */
#prism .prism-cap {
  position: absolute; left: clamp(20px, 4.5vw, 64px); bottom: clamp(78px, 13vh, 150px);
  max-width: min(46ch, 70vw); color: #f2ece1; text-shadow: 0 1px 16px rgba(0, 0, 0, .7);
  pointer-events: none
}
#prism .prism-f1 .prism-cap, #prism .prism-f2 .prism-cap { bottom: clamp(64px, 9vh, 120px) }
#prism .prism-kick {
  font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: #b9b1a3;
  margin-bottom: 10px
}
#prism .prism-title {
  font: 600 clamp(34px, 6.4vw, 74px)/1.02 system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0 0 8px; letter-spacing: -.01em
}
#prism .prism-meta { font-size: 13px; letter-spacing: .06em; color: #d8d1c4 }
#prism .prism-go {
  margin-top: 16px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: #c9a227; opacity: .55; transition: opacity .35s ease, transform .35s ease
}
#prism .prism-facet.hot .prism-go { opacity: 1; transform: translateX(4px) }

/* ── chrome ───────────────────────────────────────────────── */
#prism .prism-chrome {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: baseline;
  gap: 16px; padding: 22px clamp(20px, 4.5vw, 64px); pointer-events: none;
  color: #f2ece1; text-shadow: 0 1px 14px rgba(0, 0, 0, .65)
}
#prism .prism-mark { font-size: 18px; font-weight: 600; letter-spacing: .34em; text-transform: uppercase }
#prism .prism-tag { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: #b9b1a3 }
#prism .prism-controls { margin-left: auto; display: flex; gap: 10px; pointer-events: auto }
#prism .prism-btn {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #f2ece1;
  text-decoration: none; padding: 8px 14px; border: 1px solid rgba(242, 236, 225, .34);
  border-radius: 2px; background: rgba(12, 11, 10, .42); transition: border-color .3s ease, background .3s ease
}
#prism .prism-btn:hover { border-color: #c9a227; background: rgba(12, 11, 10, .68) }
#prism .prism-btn:focus-visible { outline: 3px solid #c9a227; outline-offset: 2px }
#prism .prism-off { opacity: .7 }
#prism .prism-hint {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: #b9b1a3;
  pointer-events: none; white-space: nowrap
}
#prism .prism-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }

@media (max-width: 720px) {
  #prism .prism-tag { display: none }
  #prism .prism-chrome { padding: 16px 18px; gap: 10px }
  #prism .prism-controls { flex-direction: column; gap: 6px }
  #prism .prism-btn { font-size: 10px; padding: 7px 10px }
  #prism .prism-cap { bottom: 108px }
  #prism .prism-hint { bottom: 14px; font-size: 9.5px }
}

@media (prefers-reduced-motion: reduce) {
  #prism, #prism .prism-facet, #prism .prism-go, #prism .prism-btn, #prism .prism-facet::after {
    transition: none !important
  }
}
