/* ===== v3: premium palette, 3D books, motion ===== */
:root {
	--ink: #0d1311;
	--ink-2: #141c19;
	--ink-3: #1c2622;
	--bone: #f2ebdb;
	--bone-dim: #aea896;
	--brass: #d4af6a;
	--brass-dim: #9a7a43;
	--gold-grad: linear-gradient(180deg, #ebcb8b 0%, #cfa65d 55%, #b98f48 100%);
	--line: rgba(212,175,106,.16);
	--ease-out: cubic-bezier(.16, 1, .3, 1);
	--ease-soft: cubic-bezier(.2, .7, .2, 1);
}
body { background: var(--ink); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
/* fine paper grain over the whole page (one static layer, no animation) */
body::before { content: ""; position: fixed; inset: 0; z-index: 200; pointer-events: none; opacity: .045;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
.price, .tier .price, .buy .price, .facts-grid b { font-variant-numeric: lining-nums tabular-nums; }

/* gold buttons with a soft sheen on hover */
.btn { border-radius: 8px; letter-spacing: .005em; }
.btn-brass { background: var(--gold-grad); color: #1d1408; box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 8px 22px -10px rgba(212,175,106,.7); position: relative; overflow: hidden; }
.btn-brass::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-18deg); transition: left .7s var(--ease-out); }
.btn-brass:hover { background: var(--gold-grad); filter: brightness(1.05); }
.btn-brass:hover::after { left: 130%; }
.btn-line { border-color: rgba(242,235,219,.35); }
.btn-line:hover { border-color: var(--bone); background: rgba(242,235,219,.06); }

/* header turns solid and slimmer once you scroll */
.site-head { transition: background .3s, box-shadow .3s; background: rgba(13,19,17,.72); }
.site-head .wrap { transition: min-height .3s var(--ease-soft); }
.site-head.scrolled { background: rgba(13,19,17,.96); box-shadow: 0 10px 30px -18px rgba(0,0,0,.8); }
.site-head.scrolled .wrap { min-height: 60px; }
.nav a:not(.btn) { position: relative; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1.5px; background: var(--brass); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease-out); }
.nav a:not(.btn):hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
@media (max-width: 860px) { .nav a:not(.btn)::after { display: none; } }

/* section heading ornament: a gold rule with a lozenge, like a Victorian bookplate */
.section-head h2::after, .page-top h1::after { content: ""; display: block; width: 74px; height: 9px; margin-top: 18px;
	background:
		linear-gradient(var(--orn, #d4af6a), var(--orn, #d4af6a)) left center / 30px 1.5px no-repeat,
		linear-gradient(var(--orn, #d4af6a), var(--orn, #d4af6a)) right center / 30px 1.5px no-repeat,
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0L10 5L5 10L0 5Z' fill='%23d4af6a'/%3E%3C/svg%3E") center / 9px 9px no-repeat; }
.download, .inside-home, .inside { --orn: #8a2a26; }
.download .section-head h2::after, .inside-home .section-head h2::after, .inside .section-head h2::after {
	background:
		linear-gradient(#8a2a26, #8a2a26) left center / 30px 1.5px no-repeat,
		linear-gradient(#8a2a26, #8a2a26) right center / 30px 1.5px no-repeat,
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0L10 5L5 10L0 5Z' fill='%238a2a26'/%3E%3C/svg%3E") center / 9px 9px no-repeat; }

/* ---------- 3D books ---------- */
.b3d { --t: 18px; display: block; perspective: 1400px; padding: 8px 14px 18px 6px; position: relative; }
.b3d::after { content: ""; position: absolute; left: 14%; right: 6%; bottom: 6px; height: 16px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.55), transparent); filter: blur(4px); transition: transform .6s var(--ease-out), opacity .6s; }
.b3d-inner { position: relative; display: block; aspect-ratio: 2 / 3; transform-style: preserve-3d; transform: rotateY(-24deg) rotateX(2deg); transition: transform .7s var(--ease-out); }
.b3d-front, .b3d-gloss, .b3d-back { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 1px 4px 4px 1px; }
.b3d-front { object-fit: cover; transform: translateZ(calc(var(--t) / 2)); }
.b3d-gloss { transform: translateZ(calc(var(--t) / 2 + .5px)); pointer-events: none;
	background: linear-gradient(90deg, rgba(0,0,0,.38) 0%, rgba(255,255,255,.16) 2.2%, rgba(0,0,0,.12) 4.5%, transparent 9%), linear-gradient(120deg, rgba(255,255,255,.12) 0%, transparent 35%); }
.b3d-back { background: #1b120c; transform: translateZ(calc(var(--t) / -2)); box-shadow: 18px 22px 30px rgba(0,0,0,.55); }
.b3d-pages { position: absolute; top: 3px; height: calc(100% - 6px); width: var(--t); left: calc(100% - var(--t) / 2 - 3px); transform: rotateY(90deg);
	background: repeating-linear-gradient(90deg, #f4ecd8 0 1px, #d9ceb4 1px 2px), #efe5cc; box-shadow: inset 0 0 8px rgba(0,0,0,.25); }
.b3d-spine { position: absolute; top: 0; height: 100%; width: var(--t); left: calc(var(--t) / -2); transform: rotateY(-90deg); background: #3c1512; box-shadow: inset 0 0 10px rgba(0,0,0,.6); }
.b3d-family .b3d-spine { background: #22406a; }
.b3d-horror .b3d-spine { background: #111; }
.b3d-horror .b3d-back { background: #0b0b0b; }
a:hover .b3d-inner, a:focus-visible .b3d-inner { transform: rotateY(-8deg) rotateX(0deg) translateY(-8px); }
a:hover .b3d::after, a:focus-visible .b3d::after { transform: scaleX(.92); opacity: .75; }

/* card + fan layouts tuned for 3D books */
.card .b3d { margin-bottom: 4px; }
.card img.b3d-front { box-shadow: none; aspect-ratio: auto; border-radius: 1px 4px 4px 1px; }
.card:hover img.b3d-front, .card:focus-visible img.b3d-front { transform: translateZ(calc(var(--t) / 2)); }
.fan { gap: 8px; }
.fan a:nth-child(odd), .fan a:hover, .fan a:focus-visible { transform: none; }
.fan img.b3d-front { box-shadow: none; aspect-ratio: auto; border-radius: 1px 4px 4px 1px; }
.fan .b3d { --t: 12px; padding: 4px 10px 14px 4px; }
.grid { gap: 40px 30px; }

/* ---------- motion: one orchestrated hero moment, gentle reveals ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: scale(1); } }
.hero-v2 .hero-photo img { animation: settle 1.6s var(--ease-out) both; }
.hero-v2 h1 .line { display: block; animation: rise .9s var(--ease-out) both; }
.hero-v2 h1 .line:nth-child(2) { animation-delay: .12s; }
.hero-v2 h1 .line:nth-child(3) { animation-delay: .24s; }
.hero-v2 .lead { animation: rise .9s .38s var(--ease-out) both; }
.hero-v2 .ctas { animation: rise .9s .5s var(--ease-out) both; }

.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal-group] > * { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.js [data-reveal-group].is-in > * { opacity: 1; transform: none; }
.js [data-reveal-group].is-in > *:nth-child(2) { transition-delay: .07s; }
.js [data-reveal-group].is-in > *:nth-child(3) { transition-delay: .14s; }
.js [data-reveal-group].is-in > *:nth-child(4) { transition-delay: .21s; }
.js [data-reveal-group].is-in > *:nth-child(5) { transition-delay: .28s; }
.js [data-reveal-group].is-in > *:nth-child(6) { transition-delay: .35s; }

/* FAQ answer eases in */
.faq details[open] p { animation: rise .45s var(--ease-out); }

/* tiers + picks get a lit edge instead of flat borders */
.tier, .pick { box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 20px 40px -28px rgba(0,0,0,.9); }
.tier.best { background: linear-gradient(180deg, #233229 0%, var(--ink-2) 70%); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 0 1px rgba(212,175,106,.5), 0 30px 60px -30px rgba(212,175,106,.35); border-color: transparent; }
.tier.best .ribbon { background: var(--gold-grad); }

@media (prefers-reduced-motion: reduce) {
	.hero-v2 .hero-photo img, .hero-v2 h1 .line, .hero-v2 .lead, .hero-v2 .ctas, .faq details[open] p { animation: none; }
	.js [data-reveal], .js [data-reveal-group] > * { opacity: 1; transform: none; transition: none; }
	.b3d-inner, .b3d::after { transition: none; }
}

.fan a { text-decoration: none; }
.fan a span { text-decoration: none; }
.fan a:hover span { text-decoration: underline; text-underline-offset: 3px; }
