/* v3 additions: the 3D book in the hero, more colour, and the relationship chart. */

/* colour light behind the hero: violet top right, magenta lower left (two hues, no rainbow) */
.hero { background:
  radial-gradient(700px 520px at 78% 38%, rgba(124,92,255,.55), transparent 70%),
  radial-gradient(520px 420px at 92% 85%, rgba(217,70,239,.32), transparent 70%),
  radial-gradient(600px 500px at 8% 100%, rgba(59,130,246,.16), transparent 70%); }
.hero h1 { background: none; color: #fff; text-shadow: 0 20px 60px rgba(124,92,255,.35); }

/* the book as a real 3D object */
.book3d-stage { position: relative; height: 620px; display: grid; place-items: center; perspective: 2200px; }
.book3d { --w: 340px; --h: 486px; --d: 46px; position: relative; width: var(--w); height: var(--h); transform-style: preserve-3d; transform: rotateY(-28deg) rotateX(8deg); transition: transform .5s cubic-bezier(.2,.7,.2,1); animation: bookIn 1.4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes bookIn { from { transform: rotateY(-70deg) rotateX(14deg) translateY(30px); opacity: 0; } to { transform: rotateY(-28deg) rotateX(8deg); opacity: 1; } }
.book3d > div { position: absolute; }
.b3-front { inset: 0; transform: translateZ(calc(var(--d) / 2)); border-radius: 2px 8px 8px 2px; overflow: hidden; box-shadow: inset 4px 0 10px rgba(0,0,0,.18); }
.b3-front img { width: 100%; height: 100%; object-fit: cover; }
.b3-front::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,.12) 100%); pointer-events: none; }
.b3-back { inset: 0; transform: translateZ(calc(var(--d) / -2)) rotateY(180deg); background: #17121f; border-radius: 8px 2px 2px 8px; }
.b3-spine { top: 0; left: 0; width: var(--d); height: var(--h); transform: rotateY(-90deg) translateZ(calc(var(--d) / 2)); background: linear-gradient(90deg, #1b1424, #241a30 45%, #1b1424); display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 26px 0; border-radius: 3px 0 0 3px; }
.b3-spine span { writing-mode: vertical-rl; transform: rotate(180deg); font: 800 15px 'Cover', sans-serif; letter-spacing: .06em; color: #f3ece1; }
.b3-spine span:last-child { color: #b49bd0; font-size: 13px; }
.b3-pages { top: 6px; right: 0; width: calc(var(--d) - 4px); height: calc(var(--h) - 12px); transform: rotateY(90deg) translateZ(calc(var(--w) - var(--d) / 2 - 2px)); background: repeating-linear-gradient(90deg, #f4ede2 0 1.2px, #ddd3c4 1.2px 2.4px); }
.book3d-shadow { position: absolute; bottom: 38px; left: 50%; width: 360px; height: 60px; transform: translateX(-46%); background: radial-gradient(closest-side, rgba(3,2,15,.75), transparent); filter: blur(6px); z-index: -1; }
@media (max-width: 980px) { .book3d-stage { height: 500px; } .book3d { --w: 260px; --h: 372px; --d: 36px; } }
@media (prefers-reduced-motion: reduce) { .book3d { animation: none; } }

/* relationship chart */
.ladder { background: linear-gradient(160deg, #221b55, #17143b 60%); border-radius: 20px; padding: 30px 32px 22px; box-shadow: var(--lift); }
.ld-head { color: var(--slate); font-size: 16px; margin-bottom: 8px; }
.ld-row { padding: 18px 0; border-top: 1px solid rgba(198,184,255,.1); }
.ld-row:first-of-type { border-top: 0; }
.ld-top { display: flex; justify-content: space-between; align-items: baseline; }
.ld-top b { font-size: 20px; font-weight: 600; color: #fff; }
.ld-top em { font-style: normal; font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
.ld-bar { height: 12px; border-radius: 99px; background: rgba(255,255,255,.06); margin: 10px 0 10px; overflow: hidden; }
.ld-bar i { display: block; height: 100%; border-radius: 99px; }
.ld-sub { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; }
.ld-sub span { color: var(--slate); font-size: 15.5px; line-height: 1.45; }
.ld-sub code { font: 500 16px 'Mono', monospace; color: #fff; white-space: nowrap; }

/* more colour through the page */
.census { background: linear-gradient(180deg, #1a1350 0%, #120e36 55%, var(--night) 100%); border-top: 0; }
.census-panel { background: linear-gradient(160deg, #241d63, #17143b 70%); }
.fact:nth-child(1) b { color: #c6b8ff; } .fact:nth-child(2) b { color: #f0abfc; } .fact:nth-child(3) b { color: #93c5fd; }
.live { background: #17143b; }
.row.flip { background: radial-gradient(800px 500px at 85% 50%, rgba(217,70,239,.12), transparent 70%); }
.raised { background: linear-gradient(160deg, #241d63, #17143b 70%); }
.mini-mx tr:first-child td { background: linear-gradient(90deg, #7c5cff, #c026d3); color: #fff; }
.mini-mx td.d { background: rgba(124,92,255,.25); }
.quote { background: linear-gradient(180deg, transparent, rgba(124,92,255,.12) 50%, transparent); }
.quote blockquote { background: linear-gradient(90deg, #fff, #e9e3ff); -webkit-background-clip: text; background-clip: text; }
.closing-card { background: linear-gradient(120deg, #5b3fd9 0%, #8e2fc9 55%, #2a1f72 100%); }
.closing-card .h2 span { color: rgba(255,255,255,.78); }
.closing-card .btn-primary { background: #fff; color: #2a1f72; box-shadow: 0 10px 24px -8px rgba(0,0,0,.5); }
.closing-card .btn-primary:hover { background: #f3ecff; color: #2a1f72; }
.go::after { border-color: #f0abfc; }
.btn-primary { background: linear-gradient(180deg, #8b6bff, #6d4cf0); }
.btn-primary:hover { background: linear-gradient(180deg, #9d82ff, #7c5cff); }
.book3d > div { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.video-card img { object-fit: cover; object-position: center 45%; }
.video-card { background: #000; }
/* the hero book sits still at one angle */
.book3d { transform: rotateY(-22deg) rotateX(6deg) !important; transition: none !important; animation: bookIn 1.2s cubic-bezier(.2,.8,.2,1) both; }
@keyframes bookIn { from { opacity: 0; transform: rotateY(-22deg) rotateX(6deg) translateY(24px); } to { opacity: 1; transform: rotateY(-22deg) rotateX(6deg); } }
a.book3d-stage:hover .book3d { filter: brightness(1.06); }
