/* ============================================================
   THE PRIMAL ORACLE — stones page
   Layers on oracle.css. Reuses its tokens; never overrides them.
   ============================================================ */

/* ---- intro ---- */
.stIntro{padding:40px 0 8px; max-width:62ch}
.stIntro h1{color:var(--moon); margin:12px 0 14px}
.stIntro h1 em{font-style:italic; color:var(--brass)}
.stIntro .lede{margin:0; text-align:left}

/* ---- keeper-stone finder ---- */
.finder{margin:26px 0 8px}
.finderCard{
  background:linear-gradient(180deg,var(--panel),var(--ink2));
  border:1px solid var(--line); border-radius:18px; padding:30px;
  box-shadow:0 30px 80px rgba(0,0,0,.45)
}
.finderCard h3{font-size:1.5rem; color:var(--moon); margin-bottom:6px}
.finderCard .field{max-width:560px}

.keeperResult{margin-top:24px; border-top:1px solid var(--line); padding-top:22px;
  animation:stRise .6s ease both}
.keeperLine{font-family:var(--serif); font-size:1.28rem; font-style:italic;
  color:var(--brass-bright); max-width:54ch; margin:0 0 18px}
.keeperLine b{font-style:normal; color:var(--moon)}

.chips{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px}
.chip{background:#0c0e1a; border:1px solid var(--line); border-radius:13px; padding:15px 16px;
  transition:border-color .2s ease, transform .2s ease}
.chip:hover{border-color:var(--brass); transform:translateY(-2px)}
.chipName{display:block; font-family:var(--serif); font-size:1.22rem; color:var(--moon); margin-bottom:4px}
.chipMean{display:block; font-size:.88rem; color:#cfcfe0; line-height:1.5}

.sunStone{display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 12px; margin:20px 0 4px;
  background:linear-gradient(180deg,var(--panel2),var(--ink2)); border:1px solid var(--line);
  border-radius:13px; padding:16px 18px}
.sunLabel{font-family:var(--sans); text-transform:uppercase; letter-spacing:.22em; font-size:.68rem;
  color:var(--brass); font-weight:600}
.sunName{font-family:var(--serif); font-size:1.4rem; color:var(--moon)}
.sunMean{flex:1 1 260px; font-size:.9rem; color:#cfcfe0}

@keyframes stRise{from{opacity:0; transform:translateY(14px)} to{opacity:1; transform:none}}

/* ---- library ---- */
.grp{font-family:var(--serif); color:var(--brass-bright); font-size:1.5rem; margin:34px 0 4px}
.grp:first-of-type{margin-top:18px}
.grpNote{margin:6px 0 0; max-width:60ch}

.libGrid{display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:14px; margin-top:14px}
.libCard{background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:20px 20px 22px;
  transition:border-color .2s ease, transform .2s ease}
.libCard:hover{border-color:var(--brass); transform:translateY(-2px)}
.libCard h4{font-family:var(--serif); font-size:1.3rem; color:var(--moon); margin:0 0 7px}
.libCard .ess{font-family:var(--serif); font-style:italic; color:var(--brass-bright); font-size:1.02rem; margin:0 0 9px}
.libCard .use{margin:0; font-size:.9rem; color:#cfcfe0; line-height:1.55}

/* ---- lunar keystones ---- */
.lunarGrid{display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:16px}
@media(max-width:720px){.lunarGrid{grid-template-columns:1fr}}
.lunarCard{position:relative; overflow:hidden;
  background:linear-gradient(180deg,var(--panel2),var(--ink2));
  border:1px solid rgba(214,193,140,.32); border-radius:16px; padding:26px}
.lunarGlow{position:absolute; top:-60px; right:-60px; width:180px; height:180px; border-radius:50%;
  background:radial-gradient(circle, rgba(245,236,210,.22), transparent 70%); pointer-events:none}
.lunarCard h4{font-family:var(--serif); font-size:1.55rem; color:var(--moon); margin:0 0 6px}
.lunarCard .ess{font-family:var(--serif); font-style:italic; color:var(--brass-bright); font-size:1.12rem; margin:0 0 12px}
.lunarCard .depth{margin:0; font-size:.96rem; color:#d8d8e6; line-height:1.62}

/* ---- cleansing & charging ---- */
.careGrid{display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; margin:8px 0 22px}
.careCard{background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:22px}
.careCard h4{font-family:var(--serif); font-size:1.32rem; color:var(--brass-bright); margin:0 0 10px}
.careCard ul{margin:8px 0 0; padding-left:1.1em}
.careCard li{margin:0 0 8px; font-size:.92rem; color:#cfcfe0; line-height:1.55}
.careCard li b{color:var(--moon); font-weight:600}
.careCard.danger{border-color:rgba(201,138,166,.4)}
.careCard.danger h4{color:var(--rose)}

.tagList{list-style:none; display:flex; flex-wrap:wrap; gap:8px; padding:0 !important; margin-top:12px !important}
.tagList li{background:#0c0e1a; border:1px solid var(--line); color:var(--brass-bright);
  padding:6px 13px; border-radius:999px; font-size:.84rem; margin:0 !important}
.rule{font-size:.82rem; color:var(--muted); margin:14px 0 0; line-height:1.5}

.rhythm{font-family:var(--serif); font-style:italic; font-size:1.3rem; color:var(--brass-bright);
  max-width:58ch; margin:6px 0 18px}
.careNote{font-size:.82rem; color:#7c7d92; max-width:70ch; margin:0;
  border-left:2px solid var(--line); padding-left:14px}

/* ---- birthstone honesty ---- */
#birthstone .prose{max-width:68ch}
#birthstone .prose p{margin:0 0 14px}

/* ---- CTA ---- */
.ctaBand{padding-top:48px}
.ctaGrid{display:grid; grid-template-columns:1fr 1fr; gap:16px}
@media(max-width:640px){.ctaGrid{grid-template-columns:1fr}}
.ctaCard{display:block; background:linear-gradient(180deg,var(--panel2),var(--ink2));
  border:1px solid var(--line); border-radius:16px; padding:28px;
  transition:border-color .2s ease, transform .2s ease, box-shadow .2s ease}
.ctaCard:hover{border-color:var(--brass); transform:translateY(-3px); box-shadow:0 18px 44px rgba(0,0,0,.45)}
.ctaIcon{display:block; font-size:1.8rem; color:var(--brass); margin-bottom:8px}
.ctaCard h3{font-family:var(--serif); font-size:1.55rem; color:var(--moon); margin:0 0 8px}
.ctaCard p{margin:0; font-size:.95rem; color:#cfcfe0}

/* ---- nav current ---- */
.top nav a[aria-current="page"]{color:var(--moon)}

/* ============================================================
   KEEPER STONES — interactive gem cards (animal profile)
   ------------------------------------------------------------
   Additive block. Loads AFTER profile.css so it overrides the old
   flat .pf-stone. Selectors below (.pf-stones / .pf-stone and the
   gem SVG layer hooks) do NOT collide with the standalone stones-
   page classes above (.libCard, .chip, .finderCard, .lunarCard...).

   Obeys doc 09 (dark-glow design language):
     - HOVER effect is a GLOW/halo, never a gradient sheen.
     - The theatrical SHEEN sweep is the RELEASE action (click), the
       one finite sweep the design law grants a non-CTA object.
     - Motion is opacity + transform only. No box-shadow animation
       loops. No filter:blur on anything that animates.
     - prefers-reduced-motion: no lift, no ramp, no sweep; hover /
       activate just lights the glow + core (opacity) + accent border.
   Glow / border / spacing read TOKENS. Gem body color is in the SVG.
   ============================================================ */

/* ---- grid --------------------------------------------------------- */
.pf-stones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-4, 1rem);
}

/* ---- the gem card (level-2 glow-card) ----------------------------- */
.pf-stone {
  --charge: 0;                     /* 0 at rest, JS ramps to 1 while held */
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  align-items: center;
  gap: 4px var(--s-4, 1rem);
  padding: var(--s-4, 1rem) var(--s-5, 1.5rem);
  background: var(--surf-1, var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--r-2, 14px);
  box-shadow: var(--e-1);
  overflow: hidden;                /* clips the corner bloom + sheen halo */
  isolation: isolate;
  cursor: pointer;
  transition:
    transform var(--dur-fast, 180ms) var(--ease-io),
    border-color var(--dur-fast, 180ms) var(--ease-io),
    box-shadow var(--dur-fast, 180ms) var(--ease-io);
}
.pf-stone:focus { outline: none; }  /* focus-visible handles the ring below */

/* corner bloom — pre-rendered gradient pseudo, opacity-only fade (doc 09 §2.1) */
.pf-stone::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--moonlight,
    radial-gradient(560px 340px at 85% -10%, var(--accent-soft), transparent 70%));
  opacity: 0;
  transition: opacity var(--dur, 320ms) var(--ease-out);
  pointer-events: none;
}

/* ---- gem holder --------------------------------------------------- */
.pf-stone .gem-wrap {
  grid-column: 1;
  grid-row: 1 / span 2;
  position: relative;
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
  display: block;
  align-self: center;
}
.pf-stone .gem {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;               /* the glow aura bleeds past the body */
}

/* rest state of the animated SVG layers */
.pf-stone .gem-core { opacity: 0.16; transition: opacity var(--dur, 320ms) var(--ease-io); }
.pf-stone .gem-glow { opacity: 0;    transition: opacity var(--dur, 320ms) var(--ease-io); }
.pf-stone .gem-sheen { opacity: 0; }
.pf-stone .gem-body,
.pf-stone .gem-core,
.pf-stone .gem-glow { transform-box: fill-box; transform-origin: center; }

/* ---- text rows ---------------------------------------------------- */
.pf-stone .role {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2, .5rem);
  font: 400 .7rem/1 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  align-self: end;
}
.pf-stone .role::before {          /* the ember dot (doc 09 §3.3) */
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--accent);
  box-shadow: var(--ember, 0 0 8px var(--accent-soft));
}
.pf-stone .nm {
  grid-column: 2;
  grid-row: 2;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--moon);
  align-self: start;
}
.pf-stone .why {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 2px;
  color: var(--body, var(--body-text));
  font-size: .92rem;
  line-height: 1.55;
}
/* care line — a mono ledger row (doc 09 §4.5) */
.pf-stone .care {
  grid-column: 1 / -1;
  font: 400 .78rem/1.5 var(--mono);
  letter-spacing: .04em;
  color: var(--muted);
}

/* ============================================================
   HOVER / FOCUS  —  a GLOW, not a sheen (doc 09 §3.2)
   ============================================================ */
.pf-stone:hover,
.pf-stone:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--e-1), 0 0 18px var(--accent-soft);
}
.pf-stone:focus-visible {          /* halo coexists with the ring */
  box-shadow: var(--e-1), 0 0 18px var(--accent-soft), 0 0 0 3px var(--sec-soft);
}
.pf-stone:hover::before,
.pf-stone:focus-visible::before,
.pf-stone:focus-within::before { opacity: 1; }

.pf-stone:hover .gem-glow,
.pf-stone:focus-visible .gem-glow,
.pf-stone:focus-within .gem-glow { opacity: .5; }
.pf-stone:hover .gem-core,
.pf-stone:focus-visible .gem-core,
.pf-stone:focus-within .gem-core { opacity: .5; }

/* ============================================================
   CHARGE  —  press and hold. JS ramps --charge 0->1.
   Core + aura scale with --charge using transform/opacity only.
   No box-shadow loop; the expanding ring is a transformed pseudo.
   ============================================================ */
.pf-stone.is-charging .gem-core {
  opacity: calc(0.5 + 0.5 * var(--charge));
  transform: scale(calc(1 + 0.35 * var(--charge)));
  transition: opacity 90ms linear, transform 90ms linear;
}
.pf-stone.is-charging .gem-glow {
  opacity: calc(0.4 + 0.5 * var(--charge));
  transform: scale(calc(1 + 0.18 * var(--charge)));
  transition: opacity 90ms linear, transform 90ms linear;
}
/* soft charge ring: a bordered pseudo that expands + fades with --charge */
.pf-stone .gem-wrap::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
}
.pf-stone.is-charging .gem-wrap::after {
  opacity: calc(0.55 * (1 - var(--charge)));
  transform: scale(calc(0.6 + 0.9 * var(--charge)));
  transition: opacity 90ms linear, transform 90ms linear;
}

/* ============================================================
   RELEASE SHIMMER  —  ONE finite sheen sweep on click-release.
   Translate the .gem-sheen band across the gem (clipped in SVG),
   with an opacity in/out + a brief glow bloom peak, then settle.
   JS clears .is-shimmer on animationend.
   ============================================================ */
@keyframes gem-shimmer {
  0%   { opacity: 0; transform: translateX(-46px); }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(62px); }
}
@keyframes gem-bloom-peak {
  0%   { opacity: .35; }
  30%  { opacity: .95; }
  100% { opacity: .35; }
}
@keyframes gem-core-peak {
  0%   { opacity: .5; }
  25%  { opacity: 1; }
  100% { opacity: .45; }
}
.pf-stone.is-shimmer .gem-sheen {
  opacity: 1;
}
.pf-stone.is-shimmer .gem-sheen-band {
  animation: gem-shimmer 800ms var(--ease-io) both;
}
.pf-stone.is-shimmer .gem-glow {
  animation: gem-bloom-peak 800ms var(--ease-out) both;
}
.pf-stone.is-shimmer .gem-core {
  animation: gem-core-peak 800ms var(--ease-out) both;
}

/* ============================================================
   LIT  —  reduced-motion activate pulse (glow on, then fade).
   Also the fallback "alive" state when motion is off.
   ============================================================ */
.pf-stone.is-lit .gem-glow { opacity: .6; }
.pf-stone.is-lit .gem-core { opacity: .85; }
.pf-stone.is-lit { border-color: var(--accent); }

/* ============================================================
   REDUCED MOTION  —  no lift, no ramp, no sweep. Everything still
   feels alive via opacity state changes + accent border only.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .pf-stone,
  .pf-stone .gem-core,
  .pf-stone .gem-glow { transition: opacity var(--dur, 320ms) var(--ease-io); }

  .pf-stone:hover,
  .pf-stone:focus-visible { transform: none; }

  .pf-stone.is-charging .gem-core,
  .pf-stone.is-charging .gem-glow {
    transform: none;
    opacity: .6;
    transition: opacity var(--dur-fast, 180ms) var(--ease-io);
  }
  .pf-stone.is-charging .gem-wrap::after { display: none; }

  .pf-stone.is-shimmer .gem-sheen-band,
  .pf-stone.is-shimmer .gem-glow,
  .pf-stone.is-shimmer .gem-core { animation: none; }
  .pf-stone.is-shimmer .gem-sheen { opacity: 0; }
  .pf-stone.is-shimmer .gem-glow { opacity: .6; }
  .pf-stone.is-shimmer .gem-core { opacity: .9; }
}
