/* 3D layer: hero scene, books, tilting and flipping cards, scroll reveals. */
#hero-3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.has-3d #hero-chart { display: none; }
.has-3d .hero { background: radial-gradient(120% 90% at 70% 15%, #123a86 0%, #0a1c43 45%, #070c18 78%); }
.has-3d .hero::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(90deg, rgba(7, 12, 24, .82) 0%, rgba(7, 12, 24, .34) 52%, rgba(7, 12, 24, 0) 78%); }
.has-3d #hero-3d { z-index: 0; }
.hero-in { z-index: 2; }
.hero { isolation: isolate; }
.hero h1 { transition: transform .22s ease-out; transform-origin: 30% 50%; text-shadow: 1px 1px 0 #2f6bff, 2px 2px 0 #2a60e6, 3px 3px 0 #2453c9, 4px 4px 0 #1d45ab, 5px 5px 0 #a8161f, 6px 6px 0 #8f1219, 7px 7px 0 #760e14, 12px 16px 26px rgba(0, 0, 0, .72); }
.hero .said, .hero .want { text-shadow: 0 2px 12px rgba(0, 0, 0, .85); }
.hero .said mark { text-shadow: none; }
.hero .tape { position: relative; }
.hero .btn { box-shadow: 0 8px 26px rgba(0, 0, 0, .5); }

/* Tilt */
.tilt { position: relative; transform-style: preserve-3d; transition: transform .16s ease-out, box-shadow .2s ease; will-change: transform; overflow: hidden; }
.tilt:hover { box-shadow: 0 24px 48px rgba(0, 0, 0, .5); }
.shine { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .2s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .2), transparent 62%); }
.tilt:hover .shine { opacity: 1; }
.five-card:hover { transform: none; }

/* Flip */
.flip3d { background: transparent; padding: 0; perspective: 1100px; display: block; transition: none; }
.flip3d:hover { transform: none; }
.f-inner { display: grid; transform-style: preserve-3d; transition: transform .62s cubic-bezier(.3, 1.3, .55, 1); }
.flip3d:hover .f-inner { transform: rotateY(9deg) rotateX(-3deg); }
.flip3d[aria-expanded="true"] .f-inner, .flip3d[aria-expanded="true"]:hover .f-inner { transform: rotateY(180deg); }
.f-front, .f-back { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 14px; padding: 18px; background: #FFFFFF; box-shadow: 0 14px 30px rgba(0, 0, 0, .4); min-width: 0; }
.f-front { display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 196px; }
.flip3d .f-a.f-back { display: grid; align-content: center; transform: rotateY(180deg); }
.flip3d .f-hint, .flip3d[aria-expanded="true"] .f-hint { display: inline; }

/* 3D books */
.books { display: flex; justify-content: center; gap: 26px; padding: 8px 0 20px; perspective: 1400px; flex-wrap: wrap; }
.book { position: relative; width: min(210px, 56vw); aspect-ratio: 8.5 / 11; transform-style: preserve-3d; transform: rotateY(-30deg) rotateX(7deg); transition: transform .45s cubic-bezier(.2, .9, .3, 1.15); filter: drop-shadow(-18px 22px 22px rgba(0, 0, 0, .55)); }
.guide:hover .book, .offer:hover .book, .book:hover { transform: rotateY(-8deg) rotateX(2deg) translateZ(30px); }
.book img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 2px 6px 6px 2px; transform: translateZ(13px); backface-visibility: hidden; }
.book::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 26px; background: linear-gradient(90deg, #05080f, #1a2438); transform: translateX(-13px) rotateY(-90deg); }
.book::after { content: ""; position: absolute; top: 3px; bottom: 3px; right: 0; width: 25px; background: repeating-linear-gradient(90deg, #f3f5f8 0 1px, #cfd7e2 1px 2px); transform: translateX(12px) rotateY(90deg); }
.book.small { width: min(118px, 34vw); }
.guide { overflow: visible; }

/* Marquee gets some attitude */
.marquee { transform: rotate(-1.2deg) scale(1.03); position: relative; z-index: 3; box-shadow: 0 12px 30px rgba(0, 0, 0, .55); }
.band { position: relative; }
.real-big { text-shadow: 0 0 34px rgba(255, 107, 94, .42); }
.band:not(.hero) h2 { text-shadow: 0 4px 0 rgba(0, 0, 0, .28); }
.stat strong { text-shadow: 0 0 30px rgba(255, 107, 94, .5); }
.btn { position: relative; }
.btn:hover { box-shadow: 0 10px 28px rgba(47, 107, 255, .5); }
.portrait { transform: perspective(900px) rotateY(9deg) rotateX(3deg); box-shadow: -18px 24px 44px rgba(0, 0, 0, .6); transition: transform .35s ease; }
.portrait:hover { transform: perspective(900px) rotateY(0) rotateX(0) scale(1.03); }

/* Scroll reveal */
.fx .rv { opacity: 0; translate: 0 44px; rotate: x 10deg; transition: opacity .7s ease, translate .7s cubic-bezier(.2, .9, .3, 1), rotate .7s ease; }
.fx .rv.tilt { transition: opacity .7s ease, translate .7s cubic-bezier(.2, .9, .3, 1), rotate .7s ease, transform .16s ease-out, box-shadow .2s ease; }
.fx .rv.in { opacity: 1; translate: 0 0; rotate: x 0deg; }

/* Cursor light */
#spot { position: fixed; left: 0; top: 0; width: 600px; height: 600px; border-radius: 50%; pointer-events: none; z-index: 30; opacity: 0; transition: opacity .3s; background: radial-gradient(circle, rgba(79, 139, 255, .16), rgba(79, 139, 255, 0) 65%); mix-blend-mode: screen; will-change: transform; }

@media (max-width: 700px) { .f-front { min-height: 150px; } .marquee { transform: rotate(-1.2deg) scale(1.06); } .portrait { transform: none; } }
@media (prefers-reduced-motion: reduce) { .book, .f-inner, .tilt, .hero h1 { transition: none; } .marquee { transform: none; } }
html, body { overflow-x: clip; }
@media (max-width: 700px) { .has-3d .hero::before { background: linear-gradient(180deg, rgba(7, 12, 24, .86) 0%, rgba(7, 12, 24, .72) 66%, rgba(7, 12, 24, .28) 100%); } }
.hero { padding-bottom: 96px; }
.has-3d .hero::before { z-index: 1; }
