/* GLPH package explorer. Page-only styles. */
.glph-band { overflow: hidden; }
.glph-hint { color: #b4b4b4; max-width: 40rem; margin-bottom: 1.6rem; }
.glph-hint-wide { display: none; }
.glph { --nickel-dark: radial-gradient(circle at 32% 28%, #5a5f66 0%, #24272b 38%, #0d0e10 72%, #2b2e33 100%); }

/* ---------- flat panels (default = mobile vertical list) ---------- */
.glph-panels { display: grid; gap: 2.6rem; }
.glph-panel-title { color: var(--paper); }
.glph-panel-sub { color: #a9a9a9; margin: 0.2rem 0 1rem; }
.glph-plate {
  position: relative;
  width: min(100%, 20rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    conic-gradient(from 210deg, rgba(255,255,255,0.10), rgba(255,255,255,0) 18%, rgba(255,255,255,0.08) 46%, rgba(255,255,255,0) 64%, rgba(255,255,255,0.12) 86%, rgba(255,255,255,0.10)),
    var(--nickel-dark);
  box-shadow: inset 0 0 0 2px #9aa0a8, inset 0 0 0 5px #1a1c1f, inset 0 0 0 6px #5c6168, 0 24px 60px rgba(0,0,0,0.6);
}
.glph-ring { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.glph-slot {
  position: absolute;
  left: 50%; top: 50%;
  width: 23%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(var(--a)) translateX(148%) rotate(calc(-1 * var(--a)));
}
.glph-slot:hover, .glph-slot:focus-within { z-index: 3; }
.glph-disc {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%; height: 100%;
  border-radius: 50%;
  text-decoration: none;
  color: #2a2c30;
  background:
    repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,0.0) 0 2px, rgba(0,0,0,0.035) 2px 3px),
    radial-gradient(circle at 34% 28%, #f6f7f9 0%, #c9cdd2 40%, #8f949b 72%, #c5c9ce 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6), 0 2px 6px rgba(0,0,0,0.55);
  filter: saturate(0.6) brightness(0.72);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
}
.glph-disc.is-lit {
  filter: none;
  background: #e9ebee;
  box-shadow: 0 0 0 2px #f3f3f3, 0 0 0 4px rgba(var(--brand-rgb), 0.9), 0 0 22px 4px rgba(120, 150, 255, 0.55);
}
.glph-disc-img {
  position: absolute; inset: 0;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  filter: grayscale(1) contrast(1.15);
}
.glph-disc-img::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.55), rgba(255,255,255,0) 45%), linear-gradient(135deg, rgba(160,170,185,0.25), rgba(40,44,52,0.35));
}
.glph-disc.is-lit:hover, .glph-disc.is-lit:focus-visible { transform: scale(1.08); box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--brand-hot), 0 0 30px 8px rgba(120, 160, 255, 0.7); }
.glph-disc.is-lit:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }
.glph-num {
  position: relative;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}
.glph-disc.is-lit .glph-num {
  position: absolute;
  bottom: -0.45rem;
  background: var(--brand);
  color: #fff;
  padding: 0.05rem 0.4rem;
  border-radius: 1rem;
}
.glph-tip {
  position: absolute;
  bottom: calc(100% + 0.55rem);
  left: 50%;
  transform: translate(-50%, 4px);
  width: max-content;
  max-width: 14rem;
  display: grid;
  gap: 0.1rem;
  text-align: center;
  background: var(--paper);
  color: var(--black);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  line-height: 1.35;
  padding: 0.45rem 0.7rem;
  border-radius: 0.7rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.glph-disc:not(.is-lit) .glph-tip { background: #2a2c30; color: #cfd2d6; }
.glph-tip b { font-weight: 400; text-transform: uppercase; opacity: 0.7; font-size: 0.62rem; }
.glph-tip span { font-family: var(--sans); font-size: 0.86rem; letter-spacing: 0; }
.glph-tip em { font-style: normal; text-transform: uppercase; font-size: 0.6rem; color: var(--brand); }
.glph-disc:not(.is-lit) .glph-tip em { color: #9aa0a8; }
.glph-disc:not(.is-lit):hover, .glph-disc:not(.is-lit):focus-visible { filter: saturate(0.6) brightness(0.9); }
.glph-disc:not(.is-lit):focus-visible { outline: 2px solid #9aa0a8; outline-offset: 5px; }
.glph-disc:hover .glph-tip, .glph-disc:focus-visible .glph-tip { opacity: 1; transform: translate(-50%, 0); }
.glph-hub {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(2rem, 6vw, 3.2rem);
  color: transparent;
  background: linear-gradient(180deg, #d9dce0, #6d727a);
  -webkit-background-clip: text; background-clip: text;
  letter-spacing: -0.02em;
  pointer-events: none;
}
.glph-list { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 0.35rem 1.4rem; max-width: 34rem; font-size: 0.95rem; color: #9da2a8; }
.glph-list li { display: flex; flex-direction: column; gap: 0.1rem; border-top: 1px solid #222; padding-top: 0.35rem; }
.glph-list-pos { color: #7d828a; min-width: 8.5rem; }
.glph-list li.is-lit .glph-list-pos { color: #9fb0ff; }
.glph-list a { color: var(--paper); }
.glph-list-note { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase; color: #6c7178; }
@media (min-width: 560px) { .glph-list { grid-template-columns: 1fr 1fr; } }
.glph-plate.is-cover { background: #2a2418; box-shadow: inset 0 0 0 1px rgba(255,236,190,0.35), 0 24px 60px rgba(0,0,0,0.6); }
.glph-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; clip-path: circle(50%); }
.glph-cover-caption { margin-top: 1.2rem; max-width: 30rem; }
.glph-cover-title { font-size: 1.35rem; color: var(--paper); letter-spacing: -0.01em; }
.glph-cover-cap { color: #b9bdc2; font-size: 0.95rem; margin-top: 0.25rem; }
.glph-noscript { color: var(--paper); }
.glph-noscript a { color: var(--paper); }

/* ---------- exploded stack (desktop) ---------- */
.glph-stack { display: none; }

@media (min-width: 900px) {
  .glph { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2rem; align-items: center; }
  .glph-hint-wide { display: inline; }
  .glph-hint-narrow { display: none; }
  .glph-stack {
    display: block;
    position: relative;
    height: 740px;
    margin-top: 1.5rem;
    perspective: 1900px;
    perspective-origin: 50% 10%;
  }
  .glph-scene {
    position: absolute;
    left: 50%; top: 68%;
    width: 330px; height: 330px;
    margin: -165px 0 0 -205px;
    transform-style: preserve-3d;
    transform: rotateX(62deg) rotateZ(-32deg);
  }
  .glph-layer {
    --lift: 0px;
    position: absolute; inset: 0;
    padding: 0; border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transform-style: preserve-3d;
    transform: translateZ(calc(var(--z) * 90px + var(--lift)));
    transition: transform 0.45s var(--ease), opacity 0.35s var(--ease);
  }
  .glph-layer { pointer-events: none; } /* clicks resolved in glph.js */
  .glph-rim { position: absolute; width: 0; height: 0; pointer-events: none; }
  .glph-layer.is-active { --lift: 34px; }
  .glph.is-ready[data-active] .glph-layer:not(.is-active) .glph-face { filter: brightness(0.62); }
  .glph.is-ready[data-active] .glph-layer:not(.is-active).is-hover .glph-face { filter: brightness(0.85); }
  .glph-layer.is-above .glph-face { opacity: 0.22; }
  .glph-layer.is-above.is-hover .glph-face { opacity: 0.45; }
  .glph-layer:focus-visible { outline: none; }
  .glph-layer:focus-visible .glph-face { box-shadow: inset 0 0 0 2px #9aa0a8, 0 0 0 3px #fff, 0 0 0 6px var(--brand-hot); }
  .glph-face {
    position: absolute; inset: 0;
    border-radius: 50%;
    background:
      conic-gradient(from 200deg, rgba(255,255,255,0.16), rgba(255,255,255,0) 20%, rgba(255,255,255,0.10) 48%, rgba(255,255,255,0) 66%, rgba(255,255,255,0.18) 88%, rgba(255,255,255,0.16)),
      var(--nickel-dark);
    box-shadow: inset 0 0 0 2px #a3a9b1, inset 0 0 0 4px #17191c;
    transition: filter 0.3s var(--ease), box-shadow 0.3s var(--ease), opacity 0.35s var(--ease);
  }
  .glph-face::before { /* edge thickness */
    content: "";
    position: absolute; inset: 0;
    border-radius: 50%;
    background: linear-gradient(90deg, #3b3f45, #9ba1a9 45%, #2c2f34);
    transform: translateZ(-5px);
  }
  .glph-face::after { /* shadow on the layer below */
    content: "";
    position: absolute; inset: 4%;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    filter: blur(14px);
    transform: translateZ(-30px);
  }
  .glph-layer.is-active .glph-face { box-shadow: inset 0 0 0 2px #e6e9ed, inset 0 0 0 4px #17191c, 0 0 40px 6px rgba(var(--brand-rgb), 0.55); }
  .glph-mini {
    position: absolute; left: 50%; top: 50%;
    width: 23%; aspect-ratio: 1;
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(var(--a)) translateX(148%);
    background: radial-gradient(circle at 34% 28%, #eef0f2, #b5bac0 45%, #7f848b 75%, #b8bcc1);
    background-size: cover;
    background-position: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.6);
    opacity: 0.8;
  }
  .glph-mini.is-lit { opacity: 1; filter: grayscale(1) contrast(1.1); box-shadow: 0 0 0 2px #f3f3f3, 0 0 14px 4px rgba(120,150,255,0.65); }
  .glph-face.glph-face-cover {
    background: url(cover.jpg) center / cover no-repeat, #8a7444;
    box-shadow: inset 0 0 0 1px rgba(255,236,190,0.4);
  }
  .glph-face.glph-face-cover::before, .glph-face.glph-face-cover::after { display: none; }
  .glph-layer.is-active .glph-face.glph-face-cover { box-shadow: inset 0 0 0 1px rgba(255,236,190,0.6), 0 0 40px 6px rgba(var(--brand-rgb), 0.5); }
  .glph-cover-mark {
    position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
    color: transparent; background: linear-gradient(180deg, #f1f2f4, #7d828a); -webkit-background-clip: text; background-clip: text;
  }
  .glph-cover-mark b { font-weight: 400; font-size: 3.8rem; letter-spacing: 0.08em; line-height: 1; }
  .glph-cover-mark i { font-style: normal; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.3em; text-transform: uppercase; }
  .glph-tag {
    position: absolute;
    left: 124%; top: 38%;
    white-space: nowrap;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9da2a8;
    transform-origin: 0 50%;
    transform: rotateZ(32deg) rotateX(-62deg);
    transition: color 0.3s var(--ease);
  }
  .glph-layer.is-hover .glph-tag, .glph-layer.is-active .glph-tag { color: var(--paper); }
  .glph-layer.is-active .glph-tag::before { content: "▸ "; }

  .glph.is-ready .glph-panel { display: none; }
  .glph.is-ready .glph-panel.is-active { display: block; }
  .glph-plate { width: min(100%, 30rem); }
  .glph-panels { min-height: 36rem; align-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .glph-layer, .glph-disc, .glph-tip, .glph-face { transition: none; }
}
