/* ==========================================================================
   The Spider Library — redesigned homepage (view/homepage-new.php)
   Self-contained: does not depend on library.css or Owl Carousel.
   ========================================================================== */

:root {
	--nh-bg: #fbf8f3;
	--nh-surface: #ffffff;
	--nh-tint: #f3ede3;
	--nh-ink: #1d1b26;
	--nh-ink-2: #545066;
	--nh-muted: #8a8598;
	--nh-line: #e7e0d4;
	--nh-primary: #5b3df5;
	--nh-primary-ink: #ffffff;
	--nh-accent: #ff7a59;
	--nh-dark: #17152b;
	--nh-radius: 22px;
	--nh-radius-sm: 14px;
	--nh-shadow: 0 1px 2px rgba(29, 27, 38, .04), 0 8px 24px rgba(29, 27, 38, .07);
	--nh-shadow-lg: 0 20px 50px rgba(29, 27, 38, .16);
	--nh-serif: "Fraunces", Georgia, "Times New Roman", serif;
	--nh-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.nh {
	margin: 0;
	background: var(--nh-bg);
	color: var(--nh-ink);
	font: 16px/1.6 var(--nh-sans);
	-webkit-font-smoothing: antialiased;
}
:where(.nh) img { max-width: 100%; display: block; }
/* :where() keeps this at zero specificity so .nh-btn-* / .nh-link colours always win */
:where(.nh) a { color: inherit; text-decoration: none; }
:where(.nh) :is(h1, h2, h3, h4) { margin: 0; line-height: 1.15; }
:where(.nh) ul { margin: 0; padding: 0; list-style: none; }

.nh-wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: 24px; }
.nh-muted { color: var(--nh-muted); }

/* ---------- Buttons & small bits ---------- */
.nh-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
	font: 600 15px var(--nh-sans); cursor: pointer; white-space: nowrap;
	transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
}
.nh-btn:hover { transform: translateY(-1px); }
.nh-btn-primary { background: var(--nh-primary); color: var(--nh-primary-ink); box-shadow: 0 6px 18px rgba(91, 61, 245, .3); }
.nh-btn-primary:hover { background: #4a2de0; }
.nh-btn-ghost { background: transparent; border-color: var(--nh-line); color: var(--nh-ink); }
.nh-btn-ghost:hover { background: var(--nh-surface); }
.nh-btn-light { background: #fff; color: var(--nh-ink); }

.nh-eyebrow {
	display: inline-block; margin-bottom: 10px;
	font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	color: var(--nh-primary);
}
.nh-link { font-weight: 600; color: var(--nh-primary); }
.nh-link:hover { text-decoration: underline; }
.nh-pill {
	display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
	border-radius: 999px; background: var(--nh-tint); font-size: 12px; font-weight: 700;
}
.nh-tag {
	display: inline-block; padding: 2px 10px; border-radius: 999px;
	background: #ffe9e2; color: #c2410c; font-size: 12px; font-weight: 700;
}

/* ---------- Top bar ---------- */
.nh-topbar { background: var(--nh-dark); color: #d9d6ea; font-size: 13px; }
.nh-topbar .nh-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; flex-wrap: wrap; }
.nh-topbar a:hover { color: #fff; }
.nh-social { display: flex; gap: 18px; }

/* ---------- Header ---------- */
.nh-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(251, 248, 243, .82);
	backdrop-filter: saturate(160%) blur(14px);
	-webkit-backdrop-filter: saturate(160%) blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.nh-header.is-scrolled { border-color: var(--nh-line); box-shadow: 0 4px 20px rgba(29, 27, 38, .06); }
.nh-header-inner { display: flex; align-items: center; gap: 28px; height: 76px; }
.nh-logo img { height: 48px; width: auto; }
.nh-nav { display: flex; gap: 4px; margin-left: auto; }
.nh-nav a {
	padding: 8px 14px; border-radius: 999px; font-weight: 500; color: var(--nh-ink-2);
	transition: background .2s ease, color .2s ease;
}
.nh-nav a:hover, .nh-nav a.is-active { background: var(--nh-tint); color: var(--nh-ink); }
.nh-header-actions { display: flex; align-items: center; gap: 10px; }

.nh-account { position: relative; }
.nh-account-menu {
	position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; padding: 8px;
	background: var(--nh-surface); border: 1px solid var(--nh-line); border-radius: var(--nh-radius-sm);
	box-shadow: var(--nh-shadow-lg);
	opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .18s ease;
}
.nh-account-menu.is-open { opacity: 1; visibility: visible; transform: none; }
.nh-account-menu a { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.nh-account-menu a:hover { background: var(--nh-tint); }

.nh-burger { display: none; width: 44px; height: 44px; border: 1px solid var(--nh-line); border-radius: 12px; background: transparent; cursor: pointer; padding: 12px 11px; flex-direction: column; justify-content: space-between; }
.nh-burger span { display: block; height: 2px; background: var(--nh-ink); border-radius: 2px; }

/* ---------- Hero ---------- */
.nh-hero { position: relative; padding: 64px 0 72px; overflow: hidden; }
.nh-hero::before {
	content: ""; position: absolute; inset: -30% -10% auto auto; width: 720px; height: 720px;
	background: radial-gradient(closest-side, rgba(91, 61, 245, .16), transparent 70%);
	pointer-events: none;
}
.nh-hero::after {
	content: ""; position: absolute; inset: auto auto -40% -10%; width: 620px; height: 620px;
	background: radial-gradient(closest-side, rgba(255, 122, 89, .15), transparent 70%);
	pointer-events: none;
}
.nh-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.nh-hero h1 {
	font-family: var(--nh-serif); font-weight: 700;
	font-size: clamp(2.6rem, 5.6vw, 4.6rem); letter-spacing: -.02em; line-height: 1.02;
}
.nh-hero h1 em { font-style: italic; color: var(--nh-primary); }
.nh-lead { margin: 22px 0 30px; font-size: 1.125rem; color: var(--nh-ink-2); max-width: 34em; }

.nh-search {
	display: flex; gap: 8px; padding: 8px; max-width: 580px;
	background: var(--nh-surface); border: 1px solid var(--nh-line); border-radius: 999px;
	box-shadow: var(--nh-shadow);
}
.nh-search input {
	flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
	padding: 0 16px; font: 15px var(--nh-sans); color: var(--nh-ink);
}
.nh-search:focus-within { border-color: var(--nh-primary); box-shadow: 0 0 0 4px rgba(91, 61, 245, .12); }

.nh-stats { display: flex; gap: 36px; margin-top: 36px; flex-wrap: wrap; }
.nh-stats strong { display: block; font-family: var(--nh-serif); font-size: 2rem; line-height: 1; }
.nh-stats span { font-size: 14px; color: var(--nh-muted); }

.nh-hero-art { position: relative; }
.nh-hero-photo {
	aspect-ratio: 4 / 4.4; border-radius: 32px 32px 32px 140px; overflow: hidden;
	box-shadow: var(--nh-shadow-lg); transform: rotate(1.5deg);
}
.nh-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.nh-float-card {
	position: absolute; left: -28px; bottom: 36px; display: flex; gap: 14px; align-items: center;
	max-width: 290px; padding: 12px 18px 12px 12px;
	background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
	border-radius: 18px; box-shadow: var(--nh-shadow-lg);
	animation: nh-float 5s ease-in-out infinite;
}
.nh-float-card img { width: 56px; height: 78px; object-fit: cover; border-radius: 8px; }
.nh-float-card p { margin: 6px 0 0; font-weight: 600; font-size: 14px; line-height: 1.3; }
@keyframes nh-float { 50% { transform: translateY(-8px); } }

/* ---------- USP ---------- */
.nh-usp { padding-bottom: 24px; }
.nh-usp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.nh-usp-item {
	display: flex; gap: 16px; align-items: center; padding: 20px 22px;
	background: var(--nh-surface); border: 1px solid var(--nh-line); border-radius: var(--nh-radius);
}
.nh-usp-item img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.nh-usp-item h3 { font-size: 1rem; }
.nh-usp-item p { margin: 4px 0 0; font-size: 14px; color: var(--nh-ink-2); }

/* ---------- Sections ---------- */
.nh-section { padding: 88px 0; }
.nh-section-tint { background: var(--nh-tint); }
.nh-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 36px; flex-wrap: wrap; }
.nh-section h2 { font-family: var(--nh-serif); font-weight: 700; font-size: clamp(1.9rem, 3.4vw, 2.75rem); letter-spacing: -.015em; }

/* ---------- Collections bento ---------- */
.nh-bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; gap: 18px; }
.nh-bento-card {
	position: relative; display: flex; justify-content: space-between; overflow: hidden;
	padding: 24px; border-radius: var(--nh-radius);
	transition: transform .25s ease, box-shadow .25s ease;
}
.nh-bento-card:hover { transform: translateY(-4px); box-shadow: var(--nh-shadow-lg); }
.nh-bento-card:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.nh-bento-card:nth-child(2) { grid-column: span 2; }
/* last row: two wide cards so the 4-col grid has no empty cells */
.nh-bento-card:nth-child(5), .nh-bento-card:nth-child(6) { grid-column: span 2; }
.nh-bento-text { position: relative; z-index: 1; display: flex; flex-direction: column; max-width: 60%; }
.nh-bento-card h3 { font-family: var(--nh-serif); font-size: 1.6rem; }
.nh-bento-card:nth-child(1) h3 { font-size: 2.6rem; }
.nh-bento-card p { margin: 6px 0 0; font-size: 14px; opacity: .8; }
.nh-count {
	margin-top: auto; align-self: flex-start; padding: 4px 12px; border-radius: 999px;
	background: rgba(255, 255, 255, .6); font-size: 13px; font-weight: 700;
}
.nh-bento-card img {
	position: absolute; right: -6px; bottom: -6px; width: 48%; max-height: 90%; object-fit: contain;
	transition: transform .35s ease;
}
.nh-bento-card:nth-child(1) img { width: 62%; }
.nh-bento-card:hover img { transform: scale(1.06) rotate(-2deg); }
.nh-tone-1 { background: #e9e4ff; }
.nh-tone-2 { background: #ffe5dc; }
.nh-tone-3 { background: #dff3e6; }
.nh-tone-4 { background: #fff1c9; }
.nh-tone-5 { background: #dcecff; }
.nh-tone-6 { background: #f6e0f1; }

/* ---------- New arrivals shelf ---------- */
.nh-scroll-btns { display: flex; gap: 8px; }
.nh-scroll-btns button {
	width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--nh-line);
	background: var(--nh-surface); font-size: 18px; cursor: pointer; color: var(--nh-ink);
	transition: background .2s ease, color .2s ease;
}
.nh-scroll-btns button:hover { background: var(--nh-ink); color: #fff; }
.nh-shelf {
	display: grid; grid-auto-flow: column; grid-auto-columns: 190px; gap: 22px;
	overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: none;
}
.nh-shelf::-webkit-scrollbar { display: none; }
.nh-book { scroll-snap-align: start; }
.nh-book-cover {
	aspect-ratio: 5 / 7; border-radius: 6px 14px 14px 6px; overflow: hidden; background: #fff;
	box-shadow: -4px 0 0 rgba(0, 0, 0, .06) inset, var(--nh-shadow);
	transition: transform .25s ease, box-shadow .25s ease;
}
.nh-book-cover img { width: 100%; height: 100%; object-fit: cover; }
.nh-book a:hover .nh-book-cover { transform: translateY(-6px) rotate(-1deg); box-shadow: var(--nh-shadow-lg); }
.nh-book-title { margin: 14px 0 2px; font-weight: 600; font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nh-book-author { margin: 0; font-size: 13px; color: var(--nh-muted); }

/* ---------- Spotlight ---------- */
.nh-spotlight { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; }
.nh-spot-card { position: relative; padding: 40px; border-radius: 28px; overflow: hidden; }
.nh-spot-mrb { background: linear-gradient(135deg, #2a1f6b, #5b3df5); color: #fff; }
.nh-spot-mrb .nh-eyebrow { color: #c9bfff; }
.nh-mrb-books { display: flex; gap: 28px; margin-top: 28px; flex-wrap: wrap; }
.nh-mrb-books figure { margin: 0; width: 180px; }
.nh-mrb-books img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; box-shadow: 0 20px 40px rgba(0, 0, 0, .35); transform: rotate(-3deg); }
.nh-mrb-books figcaption { margin-top: 16px; font-weight: 600; }
.nh-mrb-books figcaption span { display: block; font-weight: 400; font-size: 14px; opacity: .75; }
.nh-spot-rom { background: #fff1c9; }
.nh-spot-rom .nh-eyebrow { color: #b45309; }
.nh-rom-badge { position: absolute; right: -10px; top: -10px; width: 150px; opacity: .9; }
.nh-rom-list { margin: 26px 0 16px; display: grid; gap: 10px; }
.nh-rom-list li {
	font-family: var(--nh-serif); font-size: 2rem; font-weight: 700; line-height: 1.15;
}

/* ---------- Events ---------- */
.nh-section-dark { background: var(--nh-dark); color: #fff; }
.nh-section-dark .nh-eyebrow { color: #ffb4a0; }
.nh-section-dark .nh-link { color: #c9bfff; }
.nh-events { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.nh-event {
	display: flex; flex-direction: column; overflow: hidden;
	background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--nh-radius);
	transition: transform .25s ease, background .25s ease;
}
.nh-event:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .09); }
.nh-event-img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.nh-event-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.nh-event:hover .nh-event-img img { transform: scale(1.05); }
.nh-date {
	position: absolute; left: 14px; top: 14px; display: grid; place-items: center;
	width: 56px; padding: 6px 0; border-radius: 14px; background: #fff; color: var(--nh-ink); line-height: 1.1;
}
.nh-date strong { font-size: 1.3rem; }
.nh-date span { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--nh-accent); }
.nh-event-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.nh-event-body h3 { font-size: 1.1rem; }
.nh-event-body p { margin: 8px 0 16px; font-size: 14px; color: #bdb9d3; }
.nh-event-meta { margin-top: auto; font-size: 13px; color: #9a96b5; }

/* ---------- Reviews marquee ---------- */
.nh-marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.nh-marquee-track { display: flex; gap: 22px; width: max-content; animation: nh-marquee 70s linear infinite; padding: 6px 0 12px; }
.nh-marquee:hover .nh-marquee-track { animation-play-state: paused; }
@keyframes nh-marquee { to { transform: translateX(calc(-50% - 11px)); } }
.nh-review {
	display: flex; flex-direction: column; width: 380px; margin: 0; padding: 28px;
	background: var(--nh-surface); border: 1px solid var(--nh-line); border-radius: var(--nh-radius);
}
.nh-review p { margin: 0 0 20px; color: var(--nh-ink-2); }
.nh-review p::before { content: "“"; display: block; font-family: var(--nh-serif); font-size: 3rem; line-height: .6; color: var(--nh-primary); margin-bottom: 8px; }
.nh-review footer { margin-top: auto; display: flex; align-items: center; gap: 12px; font-weight: 600; }
.nh-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #e9e4ff; color: var(--nh-primary); font-weight: 700; }

/* ---------- Gallery ---------- */
.nh-gallery { columns: 4 220px; column-gap: 16px; }
.nh-gallery figure { margin: 0 0 16px; break-inside: avoid; border-radius: var(--nh-radius-sm); overflow: hidden; }
.nh-gallery img { width: 100%; transition: transform .4s ease; }
.nh-gallery figure:hover img { transform: scale(1.04); }

/* ---------- Videos ---------- */
.nh-videos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.nh-video { position: relative; aspect-ratio: 9 / 14; border-radius: var(--nh-radius); overflow: hidden; background: #000; }
.nh-video img { width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: transform .4s ease, opacity .3s ease; }
.nh-video:hover img { transform: scale(1.05); opacity: 1; }
.nh-play {
	position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%;
	background: rgba(255, 255, 255, .92); box-shadow: var(--nh-shadow-lg);
}
.nh-play::after {
	content: ""; position: absolute; left: 26px; top: 20px;
	border-left: 18px solid var(--nh-ink); border-top: 12px solid transparent; border-bottom: 12px solid transparent;
}
.nh-videos-raw img { border-radius: var(--nh-radius-sm); }

/* ---------- CTA ---------- */
.nh-cta { padding: 0 0 88px; }
.nh-cta-inner {
	display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
	padding: 48px 56px; border-radius: 32px; color: #fff;
	background: linear-gradient(120deg, var(--nh-primary), #8b5cf6 55%, var(--nh-accent));
}
.nh-cta h2 { font-family: var(--nh-serif); font-size: clamp(1.7rem, 3vw, 2.4rem); }
.nh-cta p { margin: 8px 0 0; opacity: .9; }

/* ---------- Footer ---------- */
.nh-footer { background: var(--nh-dark); color: #bdb9d3; padding: 72px 0 24px; font-size: 15px; }
.nh-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr .8fr .8fr; gap: 40px; }
.nh-footer-logo { height: 56px; width: auto; margin-bottom: 20px; }
.nh-quote { font-family: var(--nh-serif); font-size: 1.15rem; color: #fff; max-width: 26em; }
.nh-quote span { display: block; margin-top: 8px; font-family: var(--nh-sans); font-size: 14px; color: #9a96b5; }
.nh-footer h4 { margin-bottom: 16px; color: #fff; font-size: 15px; }
.nh-footer p { margin: 0 0 6px; }
.nh-footer ul { display: grid; gap: 8px; }
.nh-footer a:hover { color: #fff; }
.nh-copy { margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; color: #8a86a3; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
	.nh-nav {
		position: absolute; left: 16px; right: 16px; top: calc(100% + 8px); flex-direction: column; gap: 2px;
		padding: 10px; background: var(--nh-surface); border: 1px solid var(--nh-line); border-radius: var(--nh-radius-sm);
		box-shadow: var(--nh-shadow-lg);
		opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .18s ease;
	}
	.nh-nav.is-open { opacity: 1; visibility: visible; transform: none; }
	.nh-nav a { padding: 12px 14px; }
	.nh-header-actions { margin-left: auto; }
	.nh-burger { display: flex; }
	.nh-events { grid-template-columns: repeat(2, 1fr); }
	.nh-footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
	.nh-hero { padding: 40px 0 56px; }
	.nh-hero-grid, .nh-spotlight { grid-template-columns: 1fr; }
	.nh-hero-art { max-width: 520px; }
	.nh-float-card { left: 12px; }
	.nh-usp-grid { grid-template-columns: 1fr; }
	.nh-bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 170px; }
	.nh-bento-card:nth-child(1) { grid-column: span 2; grid-row: span 1; }
	.nh-bento-card:nth-child(1) h3 { font-size: 2rem; }
	.nh-bento-card:nth-child(2) { grid-column: span 2; }
	.nh-bento-card:nth-child(5), .nh-bento-card:nth-child(6) { grid-column: span 1; }
	.nh-videos { grid-template-columns: repeat(2, 1fr); }
	.nh-section { padding: 64px 0; }
}

@media (max-width: 560px) {
	.nh-wrap { padding-inline: 16px; }
	.nh-topbar-hours, .nh-hide-sm { display: none; }
	.nh-logo img { height: 40px; }
	.nh-search { flex-direction: column; border-radius: 20px; }
	.nh-search input { height: 44px; }
	.nh-stats { gap: 24px; }
	.nh-bento { grid-template-columns: 1fr; }
	.nh-bento-card:nth-child(n) { grid-column: auto; }
	.nh-events { grid-template-columns: 1fr; }
	.nh-shelf { grid-auto-columns: 150px; }
	.nh-spot-card { padding: 28px; }
	.nh-mrb-books figure { width: 140px; }
	.nh-review { width: 300px; }
	.nh-cta-inner { padding: 36px 28px; }
	.nh-footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.nh-marquee-track, .nh-float-card { animation: none; }
	.nh *, .nh *::before, .nh *::after { transition: none !important; }
}
