/* Home page: the link hub. Two covers, one big button to the catalogue. */

.hub-page { min-height: 100vh; min-height: 100svh; position: relative; overflow-x: clip; }

/* Ambient glows borrowed from the covers: red (left) and gold/teal (right) */
.hub-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hub-bg::before,
.hub-bg::after {
  content: "";
  position: absolute;
  width: 78vmax;
  height: 78vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.34;
}

.hub-bg::before {
  top: -22vmax;
  left: -34vmax;
  background: radial-gradient(circle, #d3121a 0%, rgba(211, 18, 26, 0) 66%);
  animation: drift-a 22s var(--ease) infinite alternate;
}

.hub-bg::after {
  bottom: -30vmax;
  right: -34vmax;
  background: radial-gradient(circle, #e0963a 0%, rgba(34, 168, 170, 0.55) 40%, rgba(34, 168, 170, 0) 68%);
  opacity: 0.3;
  animation: drift-b 26s var(--ease) infinite alternate;
}

@keyframes drift-a { to { transform: translate(6vmax, 5vmax); } }
@keyframes drift-b { to { transform: translate(-5vmax, -6vmax); } }

.hub {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 40px 22px 28px;
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

/* Header */

.hub-avatar {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 18%;
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 5px rgba(201, 168, 106, 0.14), 0 14px 30px -12px rgba(0, 0, 0, 0.8);
}

.hub-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.3rem, 9vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.hub-role {
  margin: 10px auto 0;
  max-width: 40ch;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.7;
  color: var(--bone-dim);
}

/* Cover stage: the covers are fanned out by hub.js, middle ones in front.
   slot = position, float = ambient bobbing, book = tilt/hover/entrance.
   The script sets --bw (cover width), --step (overlap) and, per slot, --t
   (position from the centre), --r (tilt), --s (scale) and --z. */

.hub-stage {
  --bw: 120px;
  --step: 0.8;
  position: relative;
  width: 100%;
  height: calc(var(--bw) / 0.56 + 30px);
}

.hub-stage:empty { display: none; }

.stage-slot {
  position: absolute;
  bottom: calc(14px - var(--t) * var(--t) * 9px);
  left: 50%;
  width: var(--bw);
  margin-left: calc(var(--bw) * (var(--t) * var(--step) - 0.5));
  z-index: var(--z);
}

.stage-float { animation: float 7s var(--ease) infinite alternate; }
.stage-slot:nth-child(2n) .stage-float { animation-duration: 8.4s; animation-delay: -3s; }
.stage-slot:nth-child(3n) .stage-float { animation-duration: 7.7s; animation-delay: -5s; }

@keyframes float {
  from { transform: translateY(0); }
  to { transform: translateY(-7px); }
}

.stage-book {
  position: relative;
  display: block;
  width: 100%;
  transform: rotate(var(--r)) scale(var(--s));
  transform-origin: 50% 100%;
  transition: transform 0.45s var(--ease);
}

.stage-book:hover,
.stage-book:focus-visible {
  transform: rotate(calc(var(--r) * 0.5)) translateY(-8px) scale(calc(var(--s) + 0.05));
  z-index: 9;
}

/* Covers keep their own proportions; some have transparent corners or parts
   that stand out of the book, so the shadow follows the picture's outline */
.stage-book img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 22px 20px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 1px rgba(255, 255, 255, 0.25));
}

/* Cover not available yet: title set on a dark panel in the book's colour */
.stage-book--text {
  aspect-ratio: 0.62;
  border-radius: 4px;
  box-shadow: 0 34px 46px -22px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  text-align: center;
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.24), transparent 72%), #0d0e0d;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
}

.stage-book--text strong {
  font-family: var(--serif);
  font-size: clamp(0.82rem, 2.8vw, 1.05rem);
  line-height: 1.1;
  color: var(--bone);
}

.stage-book--text span {
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(var(--accent-rgb));
}

/* Buttons */

.hub-actions {
  width: 100%;
  display: grid;
  gap: 12px;
}

.hub-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 24px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid rgba(239, 233, 220, 0.16);
  background: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.hub-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(239, 233, 220, 0.4);
  background: rgba(255, 255, 255, 0.09);
}

.hub-btn:active { transform: translateY(0) scale(0.985); }

.hub-btn i { font-size: 1.05rem; }

.hub-btn--primary {
  min-height: 64px;
  font-size: 1.08rem;
  color: #17120a;
  border-color: transparent;
  background: linear-gradient(135deg, #f0dba8 0%, #c9a86a 55%, #a9864a 100%);
  box-shadow: 0 18px 36px -14px rgba(201, 168, 106, 0.55);
}

.hub-btn--primary:hover {
  border-color: transparent;
  background: linear-gradient(135deg, #f6e5b9 0%, #d3b377 55%, #b4914f 100%);
  box-shadow: 0 22px 44px -14px rgba(201, 168, 106, 0.7);
}

.hub-btn--primary .arrow { transition: transform 0.3s var(--ease); }
.hub-btn--primary:hover .arrow { transform: translateX(5px); }

/* A single shine sweep across the main button */
.hub-btn--primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  animation: shine 3.6s var(--ease) 1.4s infinite;
}

@keyframes shine {
  0%, 62% { left: -60%; }
  100% { left: 130%; }
}

.hub-foot {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: rgba(180, 174, 161, 0.7);
}

@media (min-width: 700px) {
  .hub { max-width: 560px; gap: 26px; }
}

@media (max-height: 700px) {
  .hub { gap: 20px; padding-top: 24px; }
  .hub-avatar { width: 60px; height: 60px; margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .hub-bg::before,
  .hub-bg::after,
  .stage-float,
  .hub-btn--primary::after { animation: none; }
  .hub-btn--primary::after { display: none; }
  .stage-book,
  .hub-btn { transition: none; }
}
