/* ============================================================
   holocron.css: /holocron/, the Jedi Archives terminal.
   Sister page to /jarvis/ and /elmallah/: same idea, Star Wars
   grammar. A holocron turning in a projector cone, archive
   entries beside it, everything drawn in CSS.
   ============================================================ */

/* these two pages load no shared stylesheet, so they carry their own reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img, svg { display: block; max-width: 100%; }
html.smooth { scroll-behavior: smooth; }   /* added after load, so back/forward restoration is not animated */

.hc {
  --holo:    #7fd6ff;          /* projector blue */
  --holo-2:  #bfeaff;
  --amber:   #ffc94a;          /* Sith / warning */
  --ink:     #dff2ff;
  --dim:     #7f9db0;
  --line:    rgba(127, 214, 255, 0.18);
  --panel:   rgba(8, 20, 30, 0.55);

  background: #02070c;
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  min-height: 100vh;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

/* ───────────── the room ───────────── */
.hc-field { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hc-field span { position: absolute; inset: 0; display: block; }
.hc-grid {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .5;
  mask-image: radial-gradient(ellipse 120% 90% at 50% 40%, #000 15%, transparent 88%);
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 40%, #000 15%, transparent 88%);
}
.hc-glow {
  background:
    radial-gradient(46% 34% at 50% 34%, rgba(127,214,255,.13), transparent 72%),
    radial-gradient(40% 30% at 84% 76%, rgba(255,201,74,.07), transparent 74%);
}
.hc-scan {
  background: repeating-linear-gradient(to bottom, rgba(127,214,255,.05) 0 1px, transparent 1px 4px);
}

/* ───────────── top strip ───────────── */
.hc-top {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.6rem);
  border-bottom: 1px solid var(--line);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim);
}
.hc-exit { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--holo); }
.hc-exit:hover { color: #fff; }
.hc-exit svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ───────────── stage ───────────── */
.hc-stage {
  position: relative; z-index: 2;
  display: grid; gap: clamp(1.4rem, 4vw, 3rem);
  grid-template-columns: 1fr;
  padding: clamp(1.6rem, 5vw, 3.4rem) clamp(1rem, 4vw, 2.6rem) 3rem;
  max-width: 1320px; margin: 0 auto;
}
@media (min-width: 940px) { .hc-stage { grid-template-columns: 0.9fr 1.1fr; align-items: start; } }

/* the projector: a cone of light with a cube turning in it */
.hc-proj { position: relative; display: grid; place-items: center; min-height: 380px; }
.hc-cone {
  position: absolute; bottom: 6%; left: 50%; translate: -50% 0;
  width: 62%; height: 78%;
  background: linear-gradient(to top, rgba(127,214,255,.20), rgba(127,214,255,.02) 70%, transparent);
  clip-path: polygon(38% 100%, 62% 100%, 96% 0, 4% 0);
  filter: blur(1px);
  animation: hc-flicker 5.5s ease-in-out infinite;
}
@keyframes hc-flicker { 0%,100% { opacity: .85; } 43% { opacity: 1; } 47% { opacity: .7; } }
.hc-base {
  position: absolute; bottom: 4%; left: 50%; translate: -50% 0;
  width: 34%; height: 14px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(127,214,255,.5), transparent 70%);
}

/* the holocron itself, a real CSS cube */
.hc-cube {
  position: relative; width: 132px; height: 132px;
  transform-style: preserve-3d;
  animation: hc-turn 18s linear infinite;
  margin-bottom: 12%;
}
.hc-cube i {
  position: absolute; inset: 0; display: block;
  border: 1px solid rgba(191,234,255,.75);
  background:
    linear-gradient(135deg, rgba(127,214,255,.22), rgba(127,214,255,.05) 60%),
    repeating-linear-gradient(0deg, rgba(191,234,255,.10) 0 1px, transparent 1px 11px);
  box-shadow: 0 0 34px -6px rgba(127,214,255,.7), inset 0 0 26px -8px rgba(191,234,255,.9);
}
.hc-cube i:nth-child(1) { transform: translateZ(66px); }
.hc-cube i:nth-child(2) { transform: rotateY(180deg) translateZ(66px); }
.hc-cube i:nth-child(3) { transform: rotateY(90deg)  translateZ(66px); }
.hc-cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(66px); }
.hc-cube i:nth-child(5) { transform: rotateX(90deg)  translateZ(66px); }
.hc-cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(66px); }
@keyframes hc-turn { to { transform: rotateX(-18deg) rotateY(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .hc-cube { animation: none; transform: rotateX(-18deg) rotateY(-32deg); }
  .hc-cone { animation: none; }
}

.hc-caption { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; }
.hc-caption b {
  display: block; font-size: 1.15rem; font-weight: 600; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--holo-2);
}
.hc-caption span {
  display: block; margin-top: 0.4rem;
  font-family: "JetBrains Mono", monospace; font-size: 0.62rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim);
}

/* ───────────── panels ───────────── */
.hc-col { display: flex; flex-direction: column; gap: clamp(1rem, 2.4vw, 1.5rem); }
.hc-panel {
  position: relative;
  padding: 1.3rem 1.4rem 1.4rem;
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--panel);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.hc-panel::before, .hc-panel::after {   /* corner ticks */
  content: ""; position: absolute; width: 12px; height: 12px;
  border: 1px solid var(--holo); opacity: .55;
}
.hc-panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.hc-panel::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.hc-h {
  display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.9rem;
  font-family: "JetBrains Mono", monospace; font-size: 0.64rem;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--holo);
}
.hc-h i { width: 6px; height: 6px; border-radius: 50%; background: var(--holo); box-shadow: 0 0 10px var(--holo); }

.hc-name { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.hc-role { margin-top: 0.4rem; color: var(--dim); font-size: 0.9rem; }
.hc-aur {
  margin-top: 0.9rem; font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem; letter-spacing: 0.16em; color: var(--amber);
}

.hc-rows { display: flex; flex-direction: column; gap: 0.55rem; }
.hc-row {
  display: flex; justify-content: space-between; gap: 1rem;
  font-family: "JetBrains Mono", monospace; font-size: 0.7rem;
  padding-bottom: 0.5rem; border-bottom: 1px dashed rgba(127,214,255,.14);
}
.hc-row span:first-child { color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.6rem; }
.hc-row span:last-child { color: var(--ink); text-align: right; }

.hc-links { display: flex; flex-direction: column; gap: 0.4rem; }
.hc-link {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.7rem; border: 1px solid transparent; border-radius: 3px;
  font-family: "JetBrains Mono", monospace; font-size: 0.74rem;
  color: var(--ink); transition: background .25s, border-color .25s, transform .25s, color .25s;
}
.hc-link i { width: 5px; height: 5px; background: var(--holo); flex: none; rotate: 45deg; }
.hc-link em { margin-left: auto; font-style: normal; font-size: 0.58rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.hc-link:hover {
  background: rgba(127,214,255,.08); border-color: var(--line);
  transform: translateX(4px); color: #fff;
}

/* the kyber bars */
.hc-bar { display: flex; flex-direction: column; gap: 0.3rem; }
.hc-bar-top {
  display: flex; justify-content: space-between;
  font-family: "JetBrains Mono", monospace; font-size: 0.6rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim);
}
.hc-bar-track { height: 5px; border-radius: 3px; background: rgba(127,214,255,.12); overflow: hidden; }
.hc-bar-track i { display: block; height: 100%; width: var(--v, 50%); background: linear-gradient(90deg, var(--holo), var(--holo-2)); box-shadow: 0 0 12px var(--holo); }
.hc-bar + .hc-bar { margin-top: 0.75rem; }

/* saber colour chips */
.hc-sabers { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.hc-saber {
  display: flex; align-items: center; gap: 0.4rem;
  font-family: "JetBrains Mono", monospace; font-size: 0.6rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim);
  padding: 0.3rem 0.55rem; border: 1px solid var(--line); border-radius: 100px;
}
.hc-saber b { width: 20px; height: 3px; border-radius: 2px; background: var(--c); box-shadow: 0 0 10px var(--c); }

/* ───────────── bottom ───────────── */
.hc-bottom {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1rem clamp(1rem, 4vw, 2.6rem);
  border-top: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace; font-size: 0.62rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim);
}
.hc-bottom a { color: var(--holo); }
.hc-bottom a:hover { color: #fff; }
