/* Carousel Pagination Bullets */
.carousel-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.carousel-bullet {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e0e7ff;
  box-shadow: 0 1px 4px rgba(99,102,241,0.10);
  transition: background 0.25s, transform 0.25s;
  cursor: pointer;
  position: relative;
}
.carousel-bullet.active {
  background: var(--gradient);
  transform: scale(1.25);
  box-shadow: 0 2px 8px rgba(99,102,241,0.18);
  animation: bulletPulse 1.8s ease-in-out infinite;
}

/* Animated spinner ring around active bullet */
.carousel-bullet.active::before {
  content: "";
  position: absolute;
  inset: -5px; /* halo size */
  border-radius: 50%;
  background: conic-gradient(from 0deg, #7c3aed 0%, #6366f1 25%, #3b82f6 50%, #06b6d4 75%, #7c3aed 100%);
  -webkit-mask: radial-gradient(circle, transparent 8px, black 9px);
  mask: radial-gradient(circle, transparent 8px, black 9px);
  filter: blur(.1px);
  animation: bulletSpin 1.6s linear infinite;
}

@keyframes bulletSpin { to { transform: rotate(360deg); } }
@keyframes bulletPulse { 0%,100% { transform: scale(1.2); } 50% { transform: scale(1.3); } }

@media (prefers-reduced-motion: reduce) {
  .carousel-bullet.active { animation: none; }
  .carousel-bullet.active::before { animation: none; }
}
/* ReadSpace Landing Styles */
:root {
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;

  --primary: #6d5cff; /* purple */
  --primary-600: #5b4df2;
  --primary-700: #5347df;
  --accent: #6d5cff;
  --gradient: linear-gradient(135deg, #7c3aed 0%, #6366f1 50%, #3b82f6 100%);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(120deg, #f0e7ff 0%, #e0f7fa 40%, #fceabb 100%);
  line-height: 1.65;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: saturate(120%) blur(10px);
  backdrop-filter: saturate(120%) blur(10px);
  border-bottom: 1px solid #f1f5f9;
  overflow: visible; /* allow enlarged logo to overflow */
}

.nav {
  display: grid;
  /* Brand (left) | Nav (center flexible) | Actions (right) */
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  height: 72px;
  overflow: visible;
}


/* Brand (logo + text) */
.brand { position: relative; display: inline-flex; align-items: center; gap: 10px; overflow: visible; }
/* Default visual for generic brand mark (e.g., footer square) */
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--gradient);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}
/* Image logo: make crisp, scalable on hover, and avoid cropping */
img.brand-mark {
  background: none;
  object-fit: contain;
  image-rendering: auto;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  transform: translateZ(0);
  transform-origin: left center;
  will-change: transform;
  transition: transform .28s ease, box-shadow .28s ease;
}
/* Enlarge logo to the max on hover (overlays nav, no layout shift) */
/* .brand:hover img.brand-mark { ... } removed to disable logo hover enlargement */
.brand-mark.small { width: 20px; height: 20px; border-radius: 6px; }
/* Responsive, adjustable brand name beside the logo */
.brand-name { font-weight: 700; font-size: clamp(16px, 2.2vw, 20px); line-height: 1; letter-spacing: -0.01em; white-space: nowrap; }

.brand { position: relative; display: inline-flex; align-items: center; gap: 10px; overflow: visible; justify-self: start; }

.menu {
  display: flex;
  align-items: center;
  /* constrain the center menu so the brand stays flush left */
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  gap: 0;
  justify-content: center;
}

/* Give each direct child of the menu equal space and center their content */
.menu > * {
  flex: 1 1 0;
  text-align: center;
  min-width: 0; /* allow items to shrink cleanly */
}

.menu-link { color: #475569; font-weight: 500; }

.menu-link.active {
  color: #fff;
  background: var(--gradient);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(99,102,241,0.12);
  padding: 8px 18px;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}

.menu-link {
  position: relative;
  padding: 8px 18px;
  border-radius: 8px;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}

.menu-link:hover {
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  box-shadow: 0 2px 8px rgba(99,102,241,0.10);
}

.menu-link:active {
  background: #ede9fe;
  color: var(--primary-700);
}

.actions { display: flex; gap: 14px; justify-content: end; align-items: center; }
.text-link { color: #475569; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text);
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(15,23,42,0.12); }
.btn:active { transform: translateY(0); }

.btn-primary {
  color: #fff;
  border: none;
  background: var(--gradient);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.btn-ghost { background: #fff; }

.btn-lg { height: 48px; padding: 0 18px; border-radius: 12px; font-weight: 600; }

.hamburger { display: none; background: #fff; border: 1px solid var(--border); border-radius: 10px; height: 40px; width: 40px; align-items: center; justify-content: center; box-shadow: var(--shadow); }

/* Hero */
.section { padding: 72px 0; }
.section-alt {
  background: linear-gradient(120deg, #e0f7fa 0%, #f3e8ff 50%, #fceabb 100%);
}

.hero { padding-top: 56px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f1f5ff;
  color: #4f46e5;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.hero-title { margin: 18px 0 18px; font-size: 52px; line-height: 1.08; letter-spacing: -0.02em; }

.accent { color: var(--accent); }

.hero-sub { max-width: 65ch; }

.cta-row { display: flex; gap: 14px; margin: 22px 0; flex-wrap: wrap; }

.stats { display: flex; gap: 28px; margin-top: 10px; }
.stat-num { font-weight: 800; font-size: 20px; }
.stat-label { color: var(--muted); font-size: 13px; }

.hero-media { display: flex; align-items: center; justify-content: center; }
.scene { perspective: 1000px; }
.tilt-3d {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform .18s cubic-bezier(.22,1,.36,1);
  --rx: 0deg; --ry: 0deg; --scale: 1; --parallax: 0px;
  transform: translateY(var(--parallax)) rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--scale));
}
.media-card {
  width: 520px;
  max-width: 100%;
  background: #fff;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 30px 60px rgba(15,23,42,0.15);
  border: 1px solid #f1f5f9;
  position: relative;
}
.media-card img { border-radius: 16px; width: 100%; height: auto; }

/* Animated gradient border and soft glare for hero media */
.media-card::before {
  content: "";
  position: absolute; inset: 0; border-radius: 22px; padding: 2px;
  background: conic-gradient(from 0deg, #7c3aed, #6366f1, #3b82f6, #06b6d4, #7c3aed);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spinBorder 8s linear infinite;
  pointer-events: none;
}
.media-card::after {
  content: ""; position: absolute; inset: 8px 12px; border-radius: 16px;
  background: radial-gradient(120% 80% at 10% 0%, rgba(255,255,255,.7), rgba(255,255,255,0) 60%);
  mix-blend-mode: screen; opacity: .35; pointer-events: none;
}
@keyframes spinBorder { to { transform: rotate(1turn); } }

/* Section headers */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; }
.section-title { margin: 0; font-size: 28px; letter-spacing: -0.01em; }
.section-sub { max-width: 72ch; margin-left: auto; margin-right: auto; }
.centered { text-align: center; }

/* Center the Trending section header while leaving controls on the right */
#trending .section-head {
  /* center the title block horizontally */
  justify-content: center;
  position: relative; /* contain absolutely positioned controls */
}
#trending .section-head > div:first-child {
  margin: 0; /* remove any auto margins */
  text-align: center; /* center title & subtitle */
}
#trending .carousel-controls {
  position: absolute;
  right: 0;
  top: 6px; /* tweak vertical alignment to taste */
}

/* Carousel */
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 2px 8px 2px; }
.carousel::-webkit-scrollbar { height: 8px; }
.carousel::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 999px; }

/* Auto-scroll: hide scrollbar and ensure smooth continuous visual */
/* allow pointer interactions (drag) while hiding the scrollbar for a clean look */
.carousel.auto-scroll { overflow-x: auto; overflow-y: hidden; }
.carousel.auto-scroll::-webkit-scrollbar { display: none; }
/* Firefox */
.carousel.auto-scroll { scrollbar-width: none; -ms-overflow-style: none; }

.carousel-controls { display: flex; gap: 8px; }
.icon-btn { height: 38px; width: 38px; border: 1px solid var(--border); background: #fff; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }

/* Auto-toggle button styling */
.icon-btn.auto-toggle { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(180deg,#fff,#fbfbff); }
.icon-btn.auto-toggle[aria-pressed="false"] { background: #f3f4f6; }
.icon-btn.auto-toggle i { font-size: 18px; }

.book { scroll-snap-align: start; background: #fff; border: 1px solid #edf1f7; border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.cover { height: 220px; border-radius: 12px; background: #f3f4f6; background-image: var(--cover); background-size: cover; background-position: center; margin-bottom: 10px; }
.book-title { margin: 6px 0 2px; font-size: 14.5px; letter-spacing: -0.01em; }
.book-meta { color: var(--muted); font-size: 12.5px; }

.rating { margin-top: 6px; color: #fbbf24; font-size: 14px; letter-spacing: 1px; }

/* Categories */
.category-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-top: 18px; }
.category { display: grid; gap: 8px; place-items: start; background: #fff; border: 1px solid #edf1f7; border-radius: 16px; padding: 16px; box-shadow: var(--shadow); transition: transform .15s ease; }
.category:hover { transform: translateY(-3px); }
.cat-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bg); background-color: var(--bg); box-shadow: inset 0 0 0 9999px var(--bg); }
.cat-icon i { color: #4f46e5; }
.cat-name { font-weight: 600; }
.cat-count { color: var(--muted); font-size: 12.5px; }
.category {
  display: grid;
  gap: 8px;
  place-items: center;
  background: linear-gradient(135deg, #f3e8ff 0%, #e0f7fa 100%);
  border: 1px solid #edf1f7;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.category:hover { transform: translateY(-3px); }
.cat-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bg); background-color: var(--bg); box-shadow: inset 0 0 0 9999px var(--bg); }
.cat-icon i { color: #4f46e5; }
.cat-name { font-weight: 600; }
.cat-count { color: var(--muted); font-size: 12.5px; }

/* Features */
.feature-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: linear-gradient(135deg, #f3e8ff 0%, #e0f7fa 100%);
  border: 1px solid #edf1f7;
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.feature-icon {
  margin: 0 auto 10px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #a78bfa 0%, #f0ebff 100%);
  box-shadow: 0 2px 12px rgba(124,58,237,0.10);
}
.feature:nth-child(2) .feature-icon {
  background: linear-gradient(135deg, #4ade80 0%, #effff3 100%);
  box-shadow: 0 2px 12px rgba(74,222,128,0.10);
}
.feature:nth-child(3) .feature-icon {
  background: linear-gradient(135deg, #fbbf24 0%, #fff5e6 100%);
  box-shadow: 0 2px 12px rgba(251,191,36,0.10);
}
.feature-title { margin: 6px 0 6px; }
.feature-text { color: var(--muted); }

/* Testimonials */

.testi-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.testi {
  background: linear-gradient(135deg, #f3e8ff 0%, #e0f7fa 100%);
  border: none;
  border-radius: 22px;
  padding: 24px 22px 20px 22px;
  box-shadow: 0 8px 32px rgba(99,102,241,0.10), 0 1.5px 8px rgba(124,58,237,0.08);
  transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .18s cubic-bezier(.22,1,.36,1);
  position: relative;
  overflow: hidden;
}
.testi:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 16px 48px rgba(99,102,241,0.18), 0 2px 12px rgba(124,58,237,0.10);
}
.testi-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(99,102,241,0.10);
  border: 2px solid #fff;
}
.testi-name {
  font-weight: 700;
  font-size: 18px;
  color: #1e293b;
}
.testi-role {
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
}
.testi-text {
  color: #374151;
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  font-style: italic;
  quotes: "\201C" "\201D";
}
.testi .rating {
  margin-top: 6px;
  color: #fbbf24;
  font-size: 16px;
  letter-spacing: 1px;
}

/* CTA */
.cta-section { background: var(--gradient); color: #fff; padding: 86px 0; }
.cta-inner { text-align: center; }
.cta-title { margin: 0 0 6px; font-size: 34px; letter-spacing: -0.02em; }
.cta-sub { color: rgba(255,255,255,0.9); max-width: 70ch; margin: 8px auto 18px; }
.cta-buttons { display: inline-flex; gap: 12px; flex-wrap: wrap; }
.btn-light { background: #fff; border: none; color: #0f172a; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.35); box-shadow: none; }
.cta-note { color: rgba(255,255,255,0.9); font-size: 12.5px; margin-top: 14px; }

/* Footer */
.footer { padding: 40px 0 26px; background: #0f1222; color: #cbd5e1; }
.foot { display: flex; align-items: center; gap: 10px; }
.muted { color: #94a3b8; }

/* Rich footer layout */
.footer-grid { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 28px; padding-bottom: 18px; border-bottom: 1px solid rgba(148,163,184,0.15); }
.footer-brand .brand-mark { width: 40px; height: 40px; }
.footer-desc { color: #a3b2c7; max-width: 40ch; margin: 10px 0 12px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #0b0f1b; border: 1px solid rgba(148,163,184,0.18); color: #cbd5e1; box-shadow: inset 0 0 0 9999px rgba(255,255,255,0.02); }
.footer-title { color: #e2e8f0; font-weight: 700; margin-bottom: 8px; }
.footer-col { display: grid; gap: 8px; align-content: start; }
.footer-col a { color: #9fb0c5; font-size: 14px; }
.footer-col a:hover { color: #e2e8f0; }
.foot-bottom { display: flex; justify-content: space-between; gap: 12px; padding-top: 14px; color: #9fb0c5; font-size: 14px; }
.foot-links { display: flex; gap: 14px; }

@media (max-width: 900px){
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px){
  .footer-grid { grid-template-columns: 1fr; }
  .foot-bottom { flex-direction: column; align-items: start; gap: 6px; }
}

/* Responsive */
@media (max-width: 1100px) {
  .hero-title { font-size: 44px; }
  .category-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Logo hover enlargement removed for all screen sizes */

@media (max-width: 900px) {
  .nav { grid-template-columns: auto 1fr auto; }
  .menu { display: none; }
  .hamburger { display: inline-flex; }
  .actions { display: none; }
  .topbar.open .menu { display: flex; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0; background: #fff; padding: 14px 24px 18px; border-bottom: 1px solid var(--border); }
  .topbar.open .actions { display: flex; position: absolute; top: calc(72px + 200px); right: 24px; }

  .hero-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 28px; }
  .media-card { width: 100%; }
  .feature-grid, .testi-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .hero-title { font-size: 38px; }
  .section { padding: 56px 0; }
}



/* ===== Enhancements: landing animations and micro-interactions ===== */
/* Scroll reveal utility */
.reveal { opacity: 0; transform: translateY(18px) scale(.98); transition: opacity .6s ease, transform .6s cubic-bezier(0.22,1,0.36,1); transition-delay: var(--d, 0s); will-change: opacity, transform; }
.reveal.reveal-in { opacity: 1; transform: translateY(0) scale(1); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Animated hero background glow */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute; inset: -20% -10% auto -10%; height: 120%;
  background: radial-gradient( circle at 20% 20%, rgba(99,102,241,.25), rgba(99,102,241,0) 40%),
              radial-gradient( circle at 80% 0%, rgba(14,165,233,.25), rgba(14,165,233,0) 40%),
              radial-gradient( circle at 60% 60%, rgba(124,58,237,.20), rgba(124,58,237,0) 45%);
  filter: blur(30px) saturate(120%);
  transform: translate3d(0,0,0);
  animation: heroDrift 18s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}
@keyframes heroDrift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); }
  50% { transform: translate3d(2%, 1%, 0) scale(1.05); }
  100% { transform: translate3d(-1%, 2%, 0) scale(1.02); }
}

/* Gentle float for hero media */
.hero-media .media-card { animation: floatY 7.5s ease-in-out infinite; will-change: transform; }
@keyframes floatY { 0% { transform: translateY(0) } 50% { transform: translateY(-10px) } 100% { transform: translateY(0) } }

/* Lively hover for primary button */
.btn.btn-primary:hover { box-shadow: 0 16px 36px rgba(99,102,241,.45); transform: translateY(-2px); }
.btn.btn-primary:active { transform: translateY(0); box-shadow: 0 10px 24px rgba(99,102,241,.35); }

/* Subtle shimmer sweep on primary buttons */
.btn.btn-primary { position: relative; overflow: hidden; }
.btn.btn-primary::after {
  content: ""; position: absolute; top: -50%; left: -30%; width: 40%; height: 200%;
  background: linear-gradient(115deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.45) 45%, rgba(255,255,255,0) 100%);
  transform: translateX(-120%) rotate(12deg); filter: blur(2px);
}
.btn.btn-primary:hover::after { animation: sweep 1.2s ease forwards; }
@keyframes sweep { to { transform: translateX(260%) rotate(12deg); } }

/* Category, Feature, Testimonial hovers */
.category { transition: transform .18s ease, box-shadow .2s ease; }
.category:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 16px 32px rgba(15,23,42,.10); }
.feature { transition: transform .18s ease, box-shadow .2s ease; }
.feature:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(15,23,42,.12); }
.testi { transition: transform .18s ease, box-shadow .2s ease; }
.testi:hover { transform: translateY(-3px); box-shadow: 0 18px 36px rgba(15,23,42,.12); }

p { text-align: justify; text-justify: inter-word; hyphens: auto; }
.hero-sub, .home-sub, .section-sub, .feature-text, .testi-text, .cta-sub { text-align: justify; text-justify: inter-word; }
.hero-title { margin: 18px 0 18px; font-size: 52px; line-height: 1.08; letter-spacing: -0.02em; }
.hero-sub, .home-sub { max-width: 65ch; }
.section-sub { max-width: 72ch; margin-left: auto; margin-right: auto; }
.testi-text, .feature-text, .cta-sub { max-width: 72ch; }


