/* ============================================================
   SER Infotech — Scientific e-Resources
   Static site stylesheet
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* DARK THEME (default) — deep charcoal + red accent matching the SER logo */
:root, [data-theme="dark"] {
  --navy: #0f0e0d;          /* deep near-black with warm undertone */
  --navy2: #1a1614;         /* slightly lighter charcoal */
  --navy3: #241d1a;         /* card/hero backdrop */
  --gold: #e63946;          /* PRIMARY = logo red */
  --gold2: #ff5865;         /* lighter red for hover/gradients */
  --gold-dim: rgba(230,57,70,0.14);
  --teal: #a89282;          /* warm taupe (from logo brown) */
  --teal2: #c9b19c;         /* softer taupe */
  --white: #f5f0ec;         /* off-white for text (warm) */
  --white2: #d6ccc4;        /* dimmer text */
  --muted: #8a7d75;         /* muted taupe-grey */
  --card-bg: rgba(36,29,26,0.72);
  --border-line: rgba(230,57,70,0.22);
  --glow: 0 0 40px rgba(230,57,70,0.14);
  --nav-scrolled-bg: rgba(15,14,13,0.95);
  --overlay-bg: rgba(15,14,13,0.96);
  --input-bg: rgba(255,255,255,0.05);
  --input-bg-focus: rgba(230,57,70,0.06);
  --star-color: #ffffff;
  --btn-hero-color: #ffffff;
}

/* LIGHT THEME — clean white + red matching the SER logo mark */
[data-theme="light"] {
  --navy: #ffffff;
  --navy2: #faf7f5;         /* very light warm off-white */
  --navy3: #f2ece7;         /* card wash */
  --gold: #d62828;          /* deeper logo red for AA contrast on white */
  --gold2: #b71d1d;         /* darker red for hover */
  --gold-dim: rgba(214,40,40,0.10);
  --teal: #8a6f5c;          /* warm brown (from logo) */
  --teal2: #a68870;
  --white: #1a1614;         /* near-black text */
  --white2: #3f3630;
  --muted: #7a6e66;
  --card-bg: rgba(255,255,255,0.9);
  --border-line: rgba(26,22,20,0.12);
  --glow: 0 0 40px rgba(214,40,40,0.08);
  --nav-scrolled-bg: rgba(255,255,255,0.94);
  --overlay-bg: rgba(255,255,255,0.97);
  --input-bg: rgba(26,22,20,0.03);
  --input-bg-focus: rgba(214,40,40,0.06);
  --star-color: #b8a99f;
  --btn-hero-color: #ffffff;
}

/* SYSTEM THEME: follow OS preference when data-theme="system" */
@media (prefers-color-scheme: light) {
  [data-theme="system"] {
    --navy: #ffffff;
    --navy2: #faf7f5;
    --navy3: #f2ece7;
    --gold: #d62828;
    --gold2: #b71d1d;
    --gold-dim: rgba(214,40,40,0.10);
    --teal: #8a6f5c;
    --teal2: #a68870;
    --white: #1a1614;
    --white2: #3f3630;
    --muted: #7a6e66;
    --card-bg: rgba(255,255,255,0.9);
    --border-line: rgba(26,22,20,0.12);
    --glow: 0 0 40px rgba(214,40,40,0.08);
    --nav-scrolled-bg: rgba(255,255,255,0.94);
    --overlay-bg: rgba(255,255,255,0.97);
    --input-bg: rgba(26,22,20,0.03);
    --input-bg-focus: rgba(214,40,40,0.06);
    --star-color: #b8a99f;
    --btn-hero-color: #ffffff;
  }
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--navy);
  color: var(--white);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, select, textarea { font-family: inherit; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.02em;
  font-weight: 700;
}
h1 em, h2 em, h3 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
}

/* CURSOR */
/* z-index chosen to sit above EVERY dialog layer — cookie banner (9500),
   welcome modal (9999), impersonation banner, etc. — so the ring + dot are
   never hidden behind a backdrop. Modals / popups should stay at ≤9999. */
.cursor {
  width: 12px; height: 12px; background: var(--gold);
  border-radius: 50%; position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 100001;
  transform: translate(-50%,-50%);
  transition: width 0.3s, height 0.3s, background 0.3s;
}
.cursor-ring {
  width: 40px; height: 40px;
  border: 1px solid rgba(230,57,70,0.5);
  border-radius: 50%; position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 100000;
  transform: translate(-50%,-50%);
  transition: width 0.15s ease, height 0.15s ease, border-color 0.15s ease;
}
.cursor-hover { width: 20px !important; height: 20px !important; background: transparent !important; }
.cursor-ring-hover { width: 60px !important; height: 60px !important; border-color: rgba(230,57,70,0.8) !important; }

/* AUTH PAGES — never use the custom cursor. Show the OS default cursor
   (arrow / I-beam over inputs) so the sign-in / password-reset flows feel
   normal and text fields have a visible caret. */
body.auth-body,
body.auth-body * { cursor: auto !important; }
body.auth-body input,
body.auth-body textarea,
body.auth-body [contenteditable="true"] { cursor: text !important; }
body.auth-body a,
body.auth-body button,
body.auth-body [role="button"],
body.auth-body label[for],
body.auth-body select { cursor: pointer !important; }
body.auth-body .cursor,
body.auth-body .cursor-ring { display: none !important; }

/* ── Impersonation banner (master admin viewing as another user) ── */
.impersonation-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: linear-gradient(90deg, #dc2626 0%, #b91c1c 100%);
  color: #fff;
  border-bottom: 2px solid rgba(0,0,0,0.15);
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}
.impersonation-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.impersonation-icon {
  font-size: 20px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2));
  animation: impersonation-blink 2.4s ease-in-out infinite;
}
@keyframes impersonation-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.impersonation-text {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  flex: 1; min-width: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #fff !important;
}
.impersonation-text strong { font-weight: 700; letter-spacing: 0.01em; color: #fff !important; }
.impersonation-sep { opacity: 0.6; margin: 0 2px; }
.impersonation-note {
  padding: 2px 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.impersonation-exit-form { margin: 0; flex-shrink: 0; }
.impersonation-exit-btn {
  background: rgba(255,255,255,0.95);
  color: #b91c1c;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background .2s, transform .1s, box-shadow .2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  font-family: inherit;
}
.impersonation-exit-btn:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.impersonation-exit-btn:active { transform: translateY(0); }
/* Push page content below the fixed banner. Height ≈ 44px normally,
   up to ~78px on narrow screens (banner wraps). */
body[data-impersonating="1"] { padding-top: 44px; }
@media (max-width: 900px) {
  body[data-impersonating="1"] { padding-top: 78px; }
  .impersonation-note { display: none; }
}
@media (max-width: 640px) {
  .impersonation-bar-inner { padding: 8px 12px; gap: 10px; }
  .impersonation-text { font-size: 12px; }
  .impersonation-exit-btn { padding: 6px 12px; font-size: 11px; }
}

/* STARS */
.stars { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: hidden; }
.star { position: absolute; background: var(--star-color); border-radius: 50%; animation: twinkle var(--dur) ease-in-out infinite alternate; opacity: 0; }
@keyframes twinkle { 0%{opacity:0} 100%{opacity:var(--op)} }

/* SCROLLBAR */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }

/* NAV */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 0 5%;
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
  border-bottom: 1px solid transparent;
  transition: background 0.4s, box-shadow 0.4s, border-color 0.4s;
}
.navbar.scrolled {
  background: var(--nav-scrolled-bg);
  backdrop-filter: blur(20px);
  border-bottom-color: var(--border-line);
  box-shadow: 0 4px 40px rgba(0,0,0,0.4);
}
.nav-logo {
  display: flex; align-items: center; gap: 12px;
  cursor: none; text-decoration: none;
  flex-shrink: 0;
}
.nav-logo-img {
  height: 46px;
  width: auto;
  display: block;
  object-fit: contain;
  max-width: 240px;
  transition: opacity 0.25s;
}
.nav-logo:hover .nav-logo-img { opacity: 0.85; }
/* In dark mode: the logo's dark strokes disappear on the dark bg, so we frame the logo in a light plate that preserves brand colours */
[data-theme="dark"] .nav-logo,
[data-theme="dark"] .footer-logo-link {
  background: rgba(255,255,255,0.96);
  border-radius: 10px;
  padding: 6px 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.25), inset 0 0 0 1px rgba(230,57,70,0.15);
}
[data-theme="dark"] .footer-logo-link { padding: 10px 16px; }
@media (prefers-color-scheme: dark) {
  [data-theme="system"] .nav-logo,
  [data-theme="system"] .footer-logo-link {
    background: rgba(255,255,255,0.96);
    border-radius: 10px;
    padding: 6px 12px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.25), inset 0 0 0 1px rgba(230,57,70,0.15);
  }
  [data-theme="system"] .footer-logo-link { padding: 10px 16px; }
}
.footer-logo-link { display: inline-block; text-decoration: none; margin-bottom: 20px; }
.footer-logo-img {
  height: 70px;
  width: auto;
  max-width: 280px;
  display: block;
  object-fit: contain;
}
@media (max-width: 600px) {
  .nav-logo-img { height: 40px; max-width: 190px; }
  .footer-logo-img { height: 60px; }
}
/* legacy logo pieces still referenced by CSS; keep for safety */
.logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--gold), var(--teal));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 20px; font-weight: 900; color: #ffffff;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-main { font-family: 'Inter', sans-serif; font-size: 16px; color: var(--gold); letter-spacing: 0.02em; }
.logo-sub { font-size: 10px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }

.nav-links { display: flex; gap: 2px; }
.nav-links a {
  color: var(--white2); font-size: 13px; letter-spacing: 0.05em;
  padding: 8px 14px; border-radius: 6px;
  transition: color 0.3s; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: 4px; left: 50%; right: 50%;
  height: 1px; background: var(--gold);
  transition: all 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); }
.nav-links a:hover::after, .nav-links a.active::after { left: 14px; right: 14px; }

.nav-cta { display: flex; gap: 8px; align-items: center; }
.btn-outline {
  padding: 9px 22px; border-radius: 8px;
  border: 1px solid var(--border-line); color: var(--white);
  background: transparent; cursor: none;
  font-size: 13px; transition: all 0.3s;
  display: inline-flex; align-items: center;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.btn-gold {
  padding: 9px 22px; border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), #b71d1d);
  color: var(--btn-hero-color); border: none; cursor: none;
  font-size: 13px; font-weight: 600;
  transition: transform 0.3s, box-shadow 0.3s;
  display: inline-flex; align-items: center;
  box-shadow: 0 4px 20px rgba(230,57,70,0.3);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(230,57,70,0.4); }

/* Compact Sign In button, aligned with nav links */
.nav-signin {
  padding: 7px 14px;
  border-radius: 6px;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--border-line);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.25s;
  text-decoration: none;
  line-height: 1;
}
.nav-signin:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

/* Nav icon buttons (search, theme) */
.nav-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-line);
  background: transparent;
  color: var(--white2);
  cursor: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  padding: 0;
  flex-shrink: 0;
}
.nav-icon-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--gold-dim);
}
.nav-icon-btn svg { display: block; }

/* Theme menu dropdown */
.theme-menu-wrap { position: relative; display: inline-flex; }
.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  background: linear-gradient(160deg, var(--navy2), var(--navy3));
  border: 1px solid var(--border-line);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  z-index: 1001;
  animation: dropDown 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.theme-menu[hidden] { display: none; }
[data-theme="light"] .theme-menu {
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15,23,42,0.14);
}
@media (prefers-color-scheme: light) {
  [data-theme="system"] .theme-menu {
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15,23,42,0.14);
  }
}
.theme-menu-wrap[data-scope="mobile"] .theme-menu {
  right: 0;
  left: auto;
}
.theme-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: none;
  background: transparent;
  color: var(--white);
  border-radius: 8px;
  cursor: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: all 0.2s;
  width: 100%;
}
.theme-menu-item:hover {
  background: var(--gold-dim);
  color: var(--gold);
}
.theme-menu-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--input-bg);
  color: var(--white2);
  flex-shrink: 0;
}
.theme-menu-item:hover .theme-menu-icon { color: var(--gold); }
.theme-menu-item.active .theme-menu-icon {
  background: var(--gold-dim);
  color: var(--gold);
}
.theme-menu-label {
  flex: 1;
  line-height: 1;
}
.theme-menu-check {
  color: var(--gold);
  opacity: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.theme-menu-item.active .theme-menu-check { opacity: 1; }
.theme-menu-item.active {
  color: var(--gold);
  background: var(--gold-dim);
}

.mobile-actions {
  display: none;
  align-items: center;
  gap: 8px;
}

/* Hide mobile-only signin item from desktop nav-links row */
.mobile-signin-item { display: none; }

/* Search panel dropdown */
.nav-search-panel {
  position: fixed;
  top: 76px;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--overlay-bg);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-line);
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  padding: 18px 5%;
  display: none;
  animation: dropDown 0.25s ease;
}
.nav-search-panel.open { display: block; }
@keyframes dropDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.nav-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 900px;
  margin: 0 auto;
  background: var(--input-bg);
  border: 1px solid var(--border-line);
  border-radius: 12px;
  padding: 6px 12px;
  transition: border-color 0.25s, background 0.25s;
}
.nav-search-form:focus-within {
  border-color: var(--gold);
  background: var(--input-bg-focus);
}
.nav-search-form input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  outline: none;
  padding: 10px 4px;
  cursor: none;
}
.nav-search-form input::placeholder { color: var(--muted); }
.nav-search-form .nav-search-icon-inline {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.nav-search-submit {
  padding: 9px 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), #b71d1d);
  color: #0a0a0a;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-search-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(230,57,70,0.35);
}
.nav-search-close {
  width: 34px; height: 34px;
  border: 1px solid var(--border-line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  flex-shrink: 0;
}
.nav-search-close:hover { color: var(--gold); border-color: var(--gold); }

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-line);
  cursor: none;
  padding: 0;
  background: transparent;
  color: var(--white);
  transition: all 0.25s;
  flex-direction: column;
  gap: 5px;
}
.menu-toggle:hover { color: var(--gold); border-color: var(--gold); background: var(--gold-dim); }
.menu-toggle span {
  display: block; width: 20px; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* HERO */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center;
  padding: 120px 5% 60px; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse 80% 60% at 70% 50%, rgba(26,140,140,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 20% 60%, rgba(230,57,70,0.06) 0%, transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy2) 100%);
}
.hero-grid {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(230,57,70,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230,57,70,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}
.hero-orb { position: absolute; border-radius: 50%; pointer-events: none; z-index: 1; filter: blur(80px); }
.orb1 { width: 500px; height: 500px; background: rgba(26,140,140,0.12); top: -100px; right: 5%; animation: float1 8s ease-in-out infinite; }
.orb2 { width: 350px; height: 350px; background: rgba(230,57,70,0.08); bottom: -50px; right: 25%; animation: float2 10s ease-in-out infinite; }
.orb3 { width: 250px; height: 250px; background: rgba(230,57,70,0.06); top: 30%; left: 5%; animation: float1 12s ease-in-out infinite reverse; }
@keyframes float1 { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(-30px) scale(1.05)} }
@keyframes float2 { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(20px) scale(0.95)} }

.hero-content { position: relative; z-index: 2; max-width: 680px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 100px;
  border: 1px solid var(--border-line); background: var(--gold-dim);
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold2);
  margin-bottom: 28px;
  animation: fadeUp 0.8s ease both;
}
.badge-dot { width: 6px; height: 6px; background: var(--gold); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(1.4)} }

.hero h1 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(42px, 5.5vw, 76px);
  line-height: 1.08; font-weight: 700;
  animation: fadeUp 0.8s 0.1s ease both;
}
.hero h1 em {
  font-style: italic;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-desc { margin: 24px 0 40px; font-size: 17px; line-height: 1.7; color: var(--white2); font-weight: 300; animation: fadeUp 0.8s 0.2s ease both; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; animation: fadeUp 0.8s 0.3s ease both; }

.btn-hero {
  padding: 16px 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), #b71d1d);
  color: var(--btn-hero-color); border: none; cursor: none;
  font-size: 15px; font-weight: 600;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 8px 30px rgba(230,57,70,0.35);
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-hero::before {
  content: ''; position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}
.btn-hero:hover::before { left: 100%; }
.btn-hero:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(230,57,70,0.45); }

.btn-ghost {
  padding: 16px 36px; border-radius: 10px;
  border: 1px solid rgba(240,236,228,0.2); color: var(--white);
  background: rgba(255,255,255,0.04); cursor: none;
  font-size: 15px; transition: all 0.3s;
  backdrop-filter: blur(10px);
  display: inline-flex; align-items: center;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }

.hero-stats { display: flex; gap: 48px; margin-top: 64px; animation: fadeUp 0.8s 0.4s ease both; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: 'Inter', sans-serif; font-size: 32px; font-weight: 700; color: var(--gold); line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; letter-spacing: 0.06em; text-transform: uppercase; }

.hero-visual {
  position: absolute; right: 5%; top: 50%; transform: translateY(-50%);
  width: min(42%, 520px); z-index: 2;
  animation: fadeUp 1s 0.2s ease both;
}
.book-card {
  background: var(--card-bg);
  border: 1px solid var(--border-line);
  border-radius: 16px; padding: 24px;
  backdrop-filter: blur(20px);
  box-shadow: var(--glow), 0 20px 60px rgba(0,0,0,0.4);
  transition: transform 0.4s;
}
.book-card:hover { transform: translateY(-6px); }
.book-cover-hero {
  width: 100%; height: 200px; border-radius: 10px;
  background: linear-gradient(135deg, #1a3a6e, #0d2240);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 13px; color: var(--gold2);
  text-align: center; padding: 20px;
  position: relative; overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border-line);
}
.book-cover-hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--gold), var(--teal2)); }
.book-spine { position: absolute; left: 0; top: 0; bottom: 0; width: 12px; background: linear-gradient(180deg, var(--gold), #6b4a0d); border-radius: 10px 0 0 10px; }
.book-icon { font-size: 48px; margin-bottom: 12px; }
.book-title-hero { font-weight: 600; font-size: 14px; line-height: 1.4; }
.book-meta-hero { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.book-author-hero { font-size: 12px; color: var(--muted); }
.book-badge {
  background: var(--gold-dim); border: 1px solid var(--border-line);
  color: var(--gold); font-size: 10px; padding: 3px 10px;
  border-radius: 100px; letter-spacing: 0.06em;
}
.floating-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.mini-card {
  background: var(--card-bg); border: 1px solid var(--border-line);
  border-radius: 12px; padding: 14px; backdrop-filter: blur(20px);
  animation: float1 6s ease-in-out infinite;
}
.mini-card:nth-child(2) { animation: float2 7s ease-in-out infinite; }
.mini-card-icon { font-size: 22px; margin-bottom: 6px; }
.mini-card-title { font-size: 11px; font-weight: 600; color: var(--gold2); margin-bottom: 2px; }
.mini-card-sub { font-size: 10px; color: var(--muted); }

section { position: relative; z-index: 2; }
.section-label {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--teal2); margin-bottom: 16px;
}
.section-label::before { content: ''; display: block; width: 30px; height: 1px; background: var(--teal2); }
.section-title {
  font-family: 'Inter', sans-serif;
  font-size: clamp(32px, 3.5vw, 52px);
  font-weight: 700; line-height: 1.15;
}
.section-title span { color: var(--gold); font-style: italic; }

/* SERVICES */
.services { padding: 120px 5%; background: linear-gradient(180deg, var(--navy2) 0%, var(--navy3) 100%); }
.services-header { max-width: 600px; margin-bottom: 70px; }
.services-header p { margin-top: 16px; color: var(--white2); font-size: 16px; line-height: 1.7; }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service-card {
  background: var(--card-bg); border: 1px solid var(--border-line);
  border-radius: 20px; padding: 36px 32px;
  backdrop-filter: blur(20px);
  transition: transform 0.4s, border-color 0.4s, box-shadow 0.4s;
  position: relative; overflow: hidden;
  display: block;
}
.service-card:hover { transform: translateY(-8px); border-color: var(--gold); box-shadow: var(--glow); }
.service-icon {
  width: 60px; height: 60px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin-bottom: 24px;
}
.icon-db { background: linear-gradient(135deg, rgba(26,140,140,0.2), rgba(26,140,140,0.05)); border: 1px solid rgba(26,140,140,0.3); }
.icon-book { background: linear-gradient(135deg, rgba(230,57,70,0.18), rgba(230,57,70,0.05)); border: 1px solid rgba(230,57,70,0.3); }
.icon-journal { background: linear-gradient(135deg, rgba(120,80,200,0.2), rgba(120,80,200,0.05)); border: 1px solid rgba(120,80,200,0.3); }
.service-title { font-family: 'Inter', sans-serif; font-size: 22px; font-weight: 600; margin-bottom: 14px; }
.service-desc { font-size: 14px; color: var(--white2); line-height: 1.7; margin-bottom: 24px; }
.service-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--gold); font-weight: 500;
  transition: gap 0.3s;
}
.service-card:hover .service-link { gap: 14px; }
.service-number {
  position: absolute; top: 24px; right: 24px;
  font-family: 'Inter', sans-serif; font-size: 64px; font-weight: 900;
  color: rgba(230,57,70,0.05); line-height: 1;
  pointer-events: none;
}

/* FEATURED BOOKS */
.featured { padding: 120px 5%; }
.featured-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 60px; flex-wrap: wrap; gap: 16px; }
.see-all { color: var(--gold); font-size: 14px; display: inline-flex; align-items: center; gap: 8px; transition: gap 0.3s; }
.see-all:hover { gap: 14px; }
.books-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.book-item {
  border-radius: 16px; overflow: hidden;
  background: var(--card-bg); border: 1px solid var(--border-line);
  transition: transform 0.4s, box-shadow 0.4s, border-color 0.4s;
  display: block;
}
.book-item:hover { transform: translateY(-10px); box-shadow: 0 20px 60px rgba(0,0,0,0.4), var(--glow); border-color: var(--gold); }
.book-thumb {
  height: 220px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 52px;
}
.book-thumb-1 { background: linear-gradient(135deg, #0d3b6e, #061d38); }
.book-thumb-2 { background: linear-gradient(135deg, #1a3a2a, #0a1e15); }
.book-thumb-3 { background: linear-gradient(135deg, #3b1a1a, #1e0a0a); }
.book-thumb-4 { background: linear-gradient(135deg, #2a1a3b, #140a1e); }
.book-thumb-5 { background: linear-gradient(135deg, #1a2a3b, #0a141e); }
.book-thumb-6 { background: linear-gradient(135deg, #3b2a1a, #1e140a); }
.book-thumb-7 { background: linear-gradient(135deg, #2a3b1a, #141e0a); }
.book-thumb-8 { background: linear-gradient(135deg, #1a3b3b, #0a1e1e); }
.book-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(5,13,26,0.8) 0%, transparent 60%);
}
.book-thumb-label {
  position: absolute; bottom: 12px; left: 14px; z-index: 1;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold2); background: var(--gold-dim);
  padding: 3px 10px; border-radius: 100px;
  border: 1px solid var(--border-line);
}
.book-info { padding: 20px; }
.book-info-title { font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 600; margin-bottom: 6px; line-height: 1.4; }
.book-info-author { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.book-actions { display: flex; gap: 8px; }
.btn-sm { padding: 7px 16px; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: none; transition: all 0.3s; display: inline-flex; align-items: center; gap: 6px; border: none; }
.btn-sm-gold { background: linear-gradient(135deg, var(--gold), #b71d1d); color: #ffffff; }
.btn-sm-outline { border: 1px solid var(--border-line); color: var(--white2); background: transparent; }

/* CATEGORIES */
.categories { padding: 120px 5%; background: linear-gradient(180deg, var(--navy3) 0%, var(--navy) 100%); }
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-top: 60px; }
.cat-card {
  background: var(--card-bg); border: 1px solid var(--border-line);
  border-radius: 16px; padding: 24px 16px; text-align: center;
  cursor: none; transition: transform 0.4s, border-color 0.4s;
  position: relative; overflow: hidden; display: block;
}
.cat-card::before {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--teal2));
  transform: scaleX(0); transition: transform 0.4s;
}
.cat-card:hover { transform: translateY(-6px); border-color: var(--gold); }
.cat-card:hover::before { transform: scaleX(1); }
.cat-icon { font-size: 32px; margin-bottom: 12px; }
.cat-name { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--white2); }
.cat-count { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* TESTIMONIALS */
.testimonials { padding: 100px 5%; background: linear-gradient(180deg, var(--navy) 0%, var(--navy2) 100%); }
.testimonials-header { text-align: center; margin-bottom: 60px; }
.testimonials-header .section-label { justify-content: center; }
.testimonials-track-wrap { overflow: hidden; position: relative; }
.testimonials-track-wrap::before,
.testimonials-track-wrap::after { content: ''; position: absolute; top: 0; bottom: 0; width: 120px; z-index: 2; pointer-events: none; }
.testimonials-track-wrap::before { left: 0; background: linear-gradient(90deg, var(--navy2), transparent); }
.testimonials-track-wrap::after { right: 0; background: linear-gradient(-90deg, var(--navy2), transparent); }
.testimonials-track {
  display: flex; gap: 24px;
  animation: scroll-testimonials 50s linear infinite;
  width: max-content;
}
.testimonials-track:hover { animation-play-state: paused; }
@keyframes scroll-testimonials {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.testimonial-card {
  flex-shrink: 0; width: 380px;
  background: var(--card-bg); border: 1px solid var(--border-line);
  border-radius: 20px; padding: 32px;
  backdrop-filter: blur(20px);
  display: flex; flex-direction: column; gap: 20px;
  transition: border-color 0.3s, transform 0.3s;
}
.testimonial-card:hover { border-color: var(--gold); transform: translateY(-4px); }
.testimonial-quote-mark { font-family: 'Inter', sans-serif; font-size: 60px; color: var(--gold); line-height: 0.6; height: 30px; }
.testimonial-text { color: var(--white2); font-size: 15px; line-height: 1.7; font-style: italic; font-weight: 300; }
.testimonial-author { display: flex; align-items: center; gap: 14px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-line); }
.testimonial-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--teal));
  display: flex; align-items: center; justify-content: center;
  color: #ffffff; font-family: 'Inter', sans-serif; font-weight: 700; font-size: 18px;
  flex-shrink: 0;
}
.testimonial-name { font-weight: 600; font-size: 14px; color: var(--gold2); }
.testimonial-role { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* PARTNERS */
.partners { padding: 100px 5%; }
.partners-title { text-align: center; margin-bottom: 16px; }
.partners-title.section-label { justify-content: center; }
.partners-sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 60px; }
.partners-track-wrap { overflow: hidden; position: relative; }
.partners-track-wrap::before,
.partners-track-wrap::after { content: ''; position: absolute; top: 0; bottom: 0; width: 100px; z-index: 2; }
.partners-track-wrap::before { left: 0; background: linear-gradient(90deg, var(--navy), transparent); }
.partners-track-wrap::after { right: 0; background: linear-gradient(-90deg, var(--navy), transparent); }
.partners-track { display: flex; gap: 40px; animation: scroll-partners 30s linear infinite; width: max-content; }
@keyframes scroll-partners { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }
.partner-logo {
  background: var(--card-bg); border: 1px solid var(--border-line);
  border-radius: 12px; padding: 16px 28px;
  display: flex; align-items: center; justify-content: center;
  min-width: 180px; height: 70px; white-space: nowrap;
  font-size: 13px; font-weight: 500; color: var(--white2);
  transition: all 0.3s; flex-shrink: 0;
}
.partner-logo:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.partner-logo-marquee-img {
  max-height: 42px;
  max-width: 160px;
  width: auto;
  object-fit: contain;
  display: block;
}
[data-theme="light"] .partner-logo-marquee-img,
[data-theme="system"] .partner-logo-marquee-img { filter: none; }

/* CTA */
.cta-banner {
  margin: 0 5% 120px;
  border-radius: 28px;
  padding: 80px 70px;
  background: linear-gradient(135deg, #0f2040, #0a2230);
  border: 1px solid var(--border-line);
  display: flex; align-items: center; justify-content: space-between;
  position: relative; overflow: hidden;
  box-shadow: var(--glow);
  z-index: 2;
}
.cta-banner::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 80% 50%, rgba(26,140,140,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 10% 50%, rgba(230,57,70,0.07) 0%, transparent 60%);
}
.cta-text { position: relative; max-width: 520px; }
.cta-text h2 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(28px, 3vw, 44px); font-weight: 700;
  line-height: 1.2; margin-bottom: 16px;
}
.cta-text h2 span { color: var(--gold); font-style: italic; }
.cta-text p { color: var(--white2); font-size: 15px; line-height: 1.7; }
.cta-actions { position: relative; display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }

/* FOOTER */
.footer {
  background: var(--navy2);
  border-top: 1px solid var(--border-line);
  padding: 80px 5% 40px;
  position: relative; z-index: 2;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 60px; margin-bottom: 60px; }
.footer-brand p { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 20px 0 28px; max-width: 280px; }
.footer-social { display: flex; gap: 12px; }
.social-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border-line); background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: none; transition: all 0.3s; font-size: 16px;
}
.social-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.footer-col h4 { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin-bottom: 20px; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--muted); font-size: 14px; transition: color 0.3s; }
.footer-col a:hover { color: var(--white); }
.footer-contact p { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 14px; }
.contact-icon { flex-shrink: 0; font-size: 16px; margin-top: 2px; }
.footer-bottom {
  border-top: 1px solid var(--border-line); padding-top: 28px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.footer-bottom p { color: var(--muted); font-size: 13px; }

/* ANIM */
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* SEARCH */
.search-bar { position: relative; margin-top: 32px; max-width: 480px; animation: fadeUp 0.8s 0.35s ease both; }
.search-bar input {
  width: 100%; padding: 14px 56px 14px 20px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-line);
  border-radius: 10px; color: var(--white); font-size: 14px;
  outline: none; transition: all 0.3s; backdrop-filter: blur(10px);
  cursor: none;
}
.search-bar input:focus { border-color: var(--gold); background: rgba(230,57,70,0.05); }
.search-bar input::placeholder { color: var(--muted); }
.search-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: var(--gold); border: none; border-radius: 7px;
  width: 36px; height: 36px; cursor: none;
  display: flex; align-items: center; justify-content: center;
  color: #ffffff; font-size: 16px; transition: all 0.3s;
}
.search-btn:hover { background: var(--gold2); transform: translateY(-50%) scale(1.05); }

.divider { width: 60px; height: 2px; background: linear-gradient(90deg, var(--gold), transparent); margin: 20px 0; }

/* PAGE HEADER */
.page-header { padding: 160px 5% 60px; position: relative; overflow: hidden; }
.page-header::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 60% 80% at 70% 30%, rgba(26,140,140,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 10% 60%, rgba(230,57,70,0.05) 0%, transparent 60%);
}
.page-header-inner { position: relative; z-index: 1; max-width: 900px; }
.page-header h1 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(38px, 4.5vw, 62px);
  line-height: 1.1; font-weight: 700;
  margin: 12px 0 20px;
}
.page-header h1 em, .page-header h1 span { font-style: italic; color: var(--gold); }
.page-header p { color: var(--white2); font-size: 17px; line-height: 1.7; max-width: 720px; font-weight: 300; }

/* BOOKS */
.books-toolbar {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  padding: 0 5% 30px; position: relative; z-index: 2;
}
.filter-input, .filter-select {
  padding: 12px 18px; border-radius: 10px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-line);
  color: var(--white); font-size: 14px;
  outline: none; transition: all 0.3s; cursor: none;
}
.filter-input { flex: 1; min-width: 260px; }
.filter-input:focus, .filter-select:focus { border-color: var(--gold); background: rgba(230,57,70,0.05); }
.filter-input::placeholder { color: var(--muted); }
.filter-select option { background: var(--navy2); color: var(--white); }
.results-count { color: var(--muted); font-size: 13px; margin-left: auto; }
.books-page-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  padding: 20px 5% 120px;
  position: relative; z-index: 2;
}
.no-results {
  grid-column: 1 / -1; text-align: center;
  padding: 80px 20px; color: var(--muted);
}
.no-results-icon { font-size: 48px; margin-bottom: 16px; }
.no-results h3 { font-family: 'Inter', sans-serif; font-size: 24px; color: var(--white); margin-bottom: 8px; }

/* BOOK DETAIL */
.book-detail { padding: 140px 5% 100px; position: relative; z-index: 2; }
.book-detail-grid { display: grid; grid-template-columns: 380px 1fr; gap: 60px; align-items: start; }
.book-detail-cover {
  position: sticky; top: 100px;
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border-line);
  background: var(--card-bg);
  box-shadow: var(--glow), 0 20px 60px rgba(0,0,0,0.5);
}
.book-detail-thumb {
  height: 480px; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 96px;
  overflow: hidden;
}
.book-detail-thumb::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--gold), var(--teal2)); z-index: 2; }
.book-detail-thumb::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 16px; background: linear-gradient(180deg, rgba(230,57,70,0.5), rgba(230,57,70,0.3)); z-index: 2; }

/* ── Real cover image (used on catalog cards + detail page) ──
   IMPORTANT: use `object-fit: contain` so the whole cover is visible
   regardless of the publisher's aspect ratio. `cover` cropped tall
   or wide covers; users complained the tops/bottoms were being cut. */
.book-cover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  position: relative;
  z-index: 1;
}
/* Blurred backdrop clone — same <img>, filled with `cover`, then blurred +
   slightly scaled. This replaces the ugly solid-black letter-box that
   appeared when a publisher's cover didn't match the container aspect
   ratio, so the empty area now picks up the cover's own colour palette. */
.book-cover-img-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(28px) saturate(1.25) brightness(0.85);
  transform: scale(1.18);
  z-index: 0;
  pointer-events: none;
  user-select: none;
}
/* The generic .book-cover container on catalog cards — needs an explicit
   size so absolutely-positioned children (badges) sit on top of the image
   AND the image itself has room to render at its natural aspect ratio.
   Book covers are ~2:3 portrait, so height ≈ 1.4× width feels natural. */
.book-cover {
  position: relative;
  overflow: hidden;
  height: 260px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.book-cover-has-image { background: transparent !important; }
.book-cover-has-image .book-icon { display: none; }
.book-cover .book-badge {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  background: rgba(0,0,0,0.65); color: #fff; border-color: transparent;
  backdrop-filter: blur(6px);
}
/* Book-detail page uses the same img element inside .book-detail-thumb,
   which already has height:480px + overflow:hidden set above. */
.book-detail-thumb .book-cover-img { position: absolute; inset: 0; z-index: 1; }
.book-detail-cta { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.book-detail-info h1 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(32px, 3.5vw, 46px);
  line-height: 1.15; font-weight: 700;
  margin: 16px 0 12px;
}
.book-detail-author { color: var(--gold); font-size: 15px; margin-bottom: 30px; letter-spacing: 0.03em; }
.book-detail-desc { color: var(--white2); font-size: 15px; line-height: 1.8; margin-bottom: 36px; font-weight: 300; }
.book-detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--border-line); }
.meta-row { padding: 18px 0; border-bottom: 1px solid var(--border-line); display: flex; flex-direction: column; gap: 4px; }
.meta-row:nth-child(odd) { padding-right: 24px; }
.meta-row:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--border-line); }
.meta-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.meta-value { font-size: 14px; color: var(--white); font-weight: 500; }
.meta-value a { color: var(--gold); }
.meta-value a:hover { text-decoration: underline; }
.related-title {
  font-family: 'Inter', sans-serif;
  font-size: 28px; font-weight: 700;
  margin: 80px 5% 30px;
  position: relative; z-index: 2;
}
.related-title span { color: var(--gold); font-style: italic; }
.tag-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.db-feature-tag {
  padding: 5px 12px; border-radius: 100px; font-size: 11px;
  background: rgba(26,140,140,0.15); border: 1px solid rgba(26,140,140,0.3); color: var(--teal2);
}

/* CONTACT */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; padding: 40px 5% 120px; position: relative; z-index: 2; }
.contact-info { display: flex; flex-direction: column; gap: 24px; }
.contact-block {
  background: var(--card-bg); border: 1px solid var(--border-line);
  border-radius: 16px; padding: 26px; backdrop-filter: blur(20px);
  display: flex; gap: 18px; align-items: flex-start;
  transition: all 0.4s;
}
.contact-block:hover { border-color: var(--gold); transform: translateY(-4px); }
.contact-block-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  background: var(--gold-dim); border: 1px solid var(--border-line);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.contact-block h4 { font-family: 'Inter', sans-serif; font-size: 17px; margin-bottom: 6px; color: var(--gold2); }
.contact-block p { color: var(--white2); font-size: 14px; line-height: 1.6; }
.contact-form {
  background: var(--card-bg); border: 1px solid var(--border-line);
  border-radius: 20px; padding: 36px; backdrop-filter: blur(20px);
}
.contact-form h3 { font-family: 'Inter', sans-serif; font-size: 26px; margin-bottom: 8px; }
.contact-form .sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-field label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.form-field input, .form-field textarea, .form-field select {
  padding: 12px 16px; border-radius: 10px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-line);
  color: var(--white); font-size: 14px;
  outline: none; transition: all 0.3s; cursor: none;
  width: 100%;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--gold); background: rgba(230,57,70,0.05); }
.form-field textarea { min-height: 130px; resize: vertical; }
.form-success { color: var(--teal2); font-size: 13px; margin-top: 12px; display: none; }
.form-success.show { display: block; }

/* ABOUT */
.about-section { padding: 40px 5% 100px; position: relative; z-index: 2; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; margin-bottom: 80px; }
.about-text p { color: var(--white2); font-size: 16px; line-height: 1.8; margin-bottom: 18px; font-weight: 300; }
.about-visual {
  background: var(--card-bg); border: 1px solid var(--border-line);
  border-radius: 20px; padding: 40px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  backdrop-filter: blur(20px);
}
.about-stat-num { font-family: 'Inter', sans-serif; font-size: 42px; font-weight: 700; color: var(--gold); }
.about-stat-label { font-size: 12px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 4px; }
.value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.value-card {
  background: var(--card-bg); border: 1px solid var(--border-line);
  border-radius: 16px; padding: 32px; backdrop-filter: blur(20px);
  transition: all 0.4s;
}
.value-card:hover { border-color: var(--gold); transform: translateY(-6px); }
.value-icon { font-size: 32px; margin-bottom: 16px; }
.value-title { font-family: 'Inter', sans-serif; font-size: 20px; margin-bottom: 10px; }
.value-desc { color: var(--white2); font-size: 14px; line-height: 1.7; font-weight: 300; }

/* PARTNERS PAGE */
.partner-grid-page { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 40px 5% 100px; position: relative; z-index: 2; }
.partner-card {
  background: var(--card-bg); border: 1px solid var(--border-line);
  border-radius: 14px; padding: 24px 22px;
  min-height: 200px; display: flex; flex-direction: column; justify-content: flex-start;
  transition: all 0.4s; backdrop-filter: blur(20px);
  text-decoration: none;
}
.partner-card:hover { border-color: var(--gold); transform: translateY(-4px); background: var(--gold-dim); }
.partner-card h4 { font-family: 'Inter', sans-serif; font-size: 17px; color: var(--gold2); margin-bottom: 4px; margin-top: 4px; }
.partner-card p { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.partner-card .partner-count { color: var(--gold); font-size: 12px; margin-top: 12px; letter-spacing: 0; text-transform: none; }

/* Partner logo (Partners page grid) */
.partner-logo-wrap {
  height: 76px;
  display: flex; align-items: center; justify-content: flex-start;
  margin-bottom: 14px;
}
.partner-logo-img {
  max-height: 64px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}
[data-theme="light"] .partner-logo-img,
[data-theme="system"] .partner-logo-img { filter: none; }
.partner-logo-fallback {
  height: 64px; width: 64px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold-dim), transparent);
  border: 1px solid var(--border-line);
  color: var(--gold);
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.04em;
  border-radius: 12px;
}

/* JOURNALS */
.journals-list { padding: 40px 5% 120px; display: flex; flex-direction: column; gap: 20px; position: relative; z-index: 2; }
.journal-row {
  background: var(--card-bg); border: 1px solid var(--border-line);
  border-radius: 16px; padding: 28px 32px;
  display: grid; grid-template-columns: 80px 1fr auto; gap: 24px; align-items: center;
  backdrop-filter: blur(20px); transition: all 0.4s;
}
.journal-row:hover { border-color: var(--gold); transform: translateX(6px); }
.journal-icon { font-size: 44px; }
.journal-title { font-family: 'Inter', sans-serif; font-size: 20px; margin-bottom: 4px; }
.journal-meta { color: var(--muted); font-size: 13px; }
.journal-tag { padding: 6px 14px; border-radius: 100px; font-size: 11px; letter-spacing: 0.08em; background: var(--gold-dim); border: 1px solid var(--border-line); color: var(--gold); text-transform: uppercase; }

/* DATABASES */
.db-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; padding: 40px 5% 120px; position: relative; z-index: 2; }
.db-card {
  background: var(--card-bg); border: 1px solid var(--border-line);
  border-radius: 20px; padding: 36px; backdrop-filter: blur(20px);
  transition: all 0.4s;
}
.db-card:hover { border-color: var(--gold); transform: translateY(-8px); box-shadow: var(--glow); }
.db-card h3 { font-family: 'Inter', sans-serif; font-size: 24px; margin-bottom: 10px; color: var(--gold2); }
.db-card p { color: var(--white2); font-size: 14px; line-height: 1.7; margin-bottom: 18px; font-weight: 300; }
.db-features { display: flex; flex-wrap: wrap; gap: 8px; }

/* RESPONSIVE */
@media (max-width: 1100px) {
  .books-grid, .books-page-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .book-detail-grid { grid-template-columns: 1fr; }
  .book-detail-cover { position: static; max-width: 380px; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .value-grid { grid-template-columns: 1fr; }
  .partner-grid-page { grid-template-columns: repeat(2, 1fr); }
  .db-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  body, .cursor, .cursor-ring { cursor: auto !important; }
  body { cursor: auto; }
  .cursor, .cursor-ring { display: none !important; }
  * { cursor: auto !important; }

  .navbar { padding: 0 5%; gap: 10px; }
  .nav-links {
    display: none;
    position: fixed;
    top: 76px; left: 0; right: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: stretch;
    padding: 20px 5% 28px;
    gap: 6px;
    border-bottom: 1px solid var(--border-line);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    max-height: calc(100vh - 76px);
    overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 15px; text-align: left; }
  .nav-links a::after { display: none; }
  .nav-links .mobile-signin-item {
    display: block;
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border-line);
  }
  .nav-links .mobile-signin-item .nav-signin {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 14px;
    background: linear-gradient(135deg, var(--gold), #b71d1d);
    color: #ffffff;
    border: none;
  }
  .nav-cta { display: none; }
  .mobile-actions { display: inline-flex; }
  .menu-toggle { display: inline-flex; }

  .hero-visual { display: none; }
  .services-grid { grid-template-columns: 1fr; }
  .cta-banner { flex-direction: column; gap: 32px; padding: 50px 32px; }
  .cta-actions { align-items: flex-start; }
  .featured-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .testimonial-card { width: 300px; padding: 26px; }

  .nav-search-form { flex-wrap: wrap; }
  .nav-search-submit { flex: 1; }
}
@media (max-width: 600px) {
  .books-grid, .books-page-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 28px; }
  .partner-grid-page { grid-template-columns: 1fr; }
  .book-detail-meta { grid-template-columns: 1fr; }
  .meta-row:nth-child(even) { padding-left: 0; border-left: none; }
  .meta-row:nth-child(odd) { padding-right: 0; }
  .journal-row { grid-template-columns: 1fr; text-align: left; }
  .hero { padding: 110px 5% 40px; }
  .cta-banner { padding: 40px 24px; margin: 0 4% 80px; }
  .featured, .services, .categories, .testimonials, .partners { padding: 80px 5%; }
  .page-header { padding: 130px 5% 40px; }
}

/* PAGINATION */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 20px 5% 100px;
  position: relative;
  z-index: 2;
}
.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-line);
  background: var(--input-bg);
  color: var(--white2);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.25s;
  line-height: 1;
}
.page-btn:hover:not(:disabled):not(.active) {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
}
.page-btn.active {
  background: linear-gradient(135deg, var(--gold), #b71d1d);
  border-color: var(--gold);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(230,57,70,0.25);
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-btn .arrow { font-size: 16px; line-height: 1; }
.page-ellipsis {
  min-width: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  user-select: none;
  padding: 0 4px;
}
@media (max-width: 600px) {
  .page-btn { min-width: 34px; height: 34px; padding: 0 8px; font-size: 13px; }
}


/* SIGN-IN MODAL */
body.modal-open { overflow: hidden; }
.signin-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.signin-modal.open { opacity: 1; }
.signin-modal[hidden] { display: none; }
.signin-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 18, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
[data-theme="light"] .signin-backdrop,
[data-theme="system"] .signin-backdrop {
  background: rgba(15, 23, 42, 0.35);
}
@media (prefers-color-scheme: light) {
  [data-theme="system"] .signin-backdrop { background: rgba(15, 23, 42, 0.35); }
}
.signin-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(160deg, var(--navy2), var(--navy3));
  border: 1px solid var(--border-line);
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), var(--glow);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
  cursor: none;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
[data-theme="light"] .signin-card {
  background: linear-gradient(160deg, #ffffff, #f6f7fa);
  box-shadow: 0 30px 80px rgba(15,23,42,0.18), 0 0 40px rgba(184,145,46,0.06);
}
@media (prefers-color-scheme: light) {
  [data-theme="system"] .signin-card {
    background: linear-gradient(160deg, #ffffff, #f6f7fa);
    box-shadow: 0 30px 80px rgba(15,23,42,0.18), 0 0 40px rgba(184,145,46,0.06);
  }
}
.signin-modal.open .signin-card {
  transform: translateY(0) scale(1);
}
.signin-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-line);
  background: transparent;
  color: var(--muted);
  cursor: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
}
.signin-close:hover { color: var(--gold); border-color: var(--gold); background: var(--gold-dim); }

.signin-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border-line);
  background: var(--gold-dim);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold2);
  margin-bottom: 18px;
}
.signin-title {
  font-family: 'Inter', sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.signin-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
}
.signin-sub {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 22px;
  font-weight: 400;
}

.signin-demo-hint {
  margin: -8px 0 22px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--gold-dim);
  border: 1px dashed var(--border-line);
  color: var(--white2);
  font-size: 12px;
  line-height: 1.55;
}
.signin-demo-hint strong { color: var(--gold); font-weight: 600; }
.signin-demo-hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-line);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--gold2);
}
[data-theme="light"] .signin-demo-hint code { background: rgba(255,255,255,0.6); color: var(--gold); }
@media (prefers-color-scheme: light) {
  [data-theme="system"] .signin-demo-hint code { background: rgba(255,255,255,0.6); color: var(--gold); }
}

.signin-form { display: flex; flex-direction: column; gap: 14px; }
.signin-field { display: flex; flex-direction: column; gap: 6px; }
.signin-field label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.signin-label-row { display: flex; align-items: center; justify-content: space-between; }
.signin-forgot {
  font-size: 12px;
  color: var(--gold);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  transition: opacity 0.2s;
}
.signin-forgot:hover { opacity: 0.8; }
.signin-field input[type="email"],
.signin-field input[type="password"],
.signin-field input[type="text"] {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--input-bg);
  border: 1px solid var(--border-line);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: all 0.25s;
  cursor: none;
  width: 100%;
}
.signin-field input:focus {
  border-color: var(--gold);
  background: var(--input-bg-focus);
  box-shadow: 0 0 0 3px rgba(230,57,70,0.1);
}
.signin-field input::placeholder { color: var(--muted); }

.signin-password-wrap { position: relative; }
.signin-password-wrap input { padding-right: 42px; }
.signin-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.signin-eye:hover { color: var(--gold); }

.signin-row { display: flex; align-items: center; justify-content: space-between; }
.signin-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--white2);
  font-size: 13px;
  cursor: none;
  user-select: none;
}
.signin-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: none;
}

.signin-error {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(220,53,69,0.12);
  border: 1px solid rgba(220,53,69,0.35);
  color: #ff8a8a;
  font-size: 13px;
}
[data-theme="light"] .signin-error { color: #b00020; }
@media (prefers-color-scheme: light) {
  [data-theme="system"] .signin-error { color: #b00020; }
}

.signin-submit {
  margin-top: 4px;
  padding: 13px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), #b71d1d);
  color: #ffffff;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: none;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(230,57,70,0.28);
}
.signin-submit:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(230,57,70,0.38); }
.signin-submit.loading { pointer-events: none; opacity: 0.85; }
.signin-submit.loading .signin-submit-label { opacity: 0.4; }
.signin-spinner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(10,22,40,0.25);
  border-top-color: #ffffff;
  border-radius: 50%;
  opacity: 0;
  animation: signinSpin 0.8s linear infinite;
}
.signin-submit.loading .signin-spinner { opacity: 1; }
@keyframes signinSpin { to { transform: rotate(360deg); } }

.signin-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.signin-divider::before,
.signin-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-line);
}

.signin-alt {
  display: block;
  text-align: center;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-line);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: none;
  transition: all 0.25s;
}
.signin-alt:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
}

.signin-foot {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 18px;
}
.signin-foot a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
}
.signin-foot a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .signin-card, .signin-close, .signin-submit, .signin-alt, .signin-eye, .signin-check, .signin-check input, .signin-field input { cursor: auto !important; }
}
@media (max-width: 480px) {
  .signin-card { padding: 28px 22px 22px; border-radius: 16px; }
  .signin-title { font-size: 26px; }
}

/* PER-PAGE selector next to filters */
.per-page-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  padding: 0 4px;
}
.per-page-wrap label {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--muted);
}


/* RECENTLY VIEWED STRIP */
.recent-strip {
  padding: 4px 5% 24px;
  position: relative;
  z-index: 2;
}
.recent-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.recent-clear {
  background: transparent;
  border: 1px solid var(--border-line);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: none;
  transition: all 0.25s;
}
.recent-clear:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--gold-dim);
}
.recent-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}
.recent-row::-webkit-scrollbar { height: 6px; }
.recent-row::-webkit-scrollbar-track { background: transparent; }
.recent-row::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; opacity: 0.5; }

.recent-card {
  flex: 0 0 260px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border-line);
  backdrop-filter: blur(20px);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  text-decoration: none;
  color: inherit;
  scroll-snap-align: start;
  cursor: none;
}
.recent-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3), var(--glow);
}
.recent-thumb {
  width: 52px;
  height: 68px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.recent-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(5,13,26,0.55) 0%, transparent 60%);
}
.recent-thumb-icon {
  position: relative;
  z-index: 1;
  font-size: 26px;
}
.recent-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.recent-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-author {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .recent-card { flex: 0 0 220px; }
}


/* -------- Auth (login) page -------- */
.auth-page-main { min-height: calc(100vh - 200px); position: relative; }
.auth-shell {
  position: relative;
  padding: 80px 5% 120px;
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 460px;
  background: var(--navy2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 24px;
  padding: 44px 40px 36px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.35);
  backdrop-filter: blur(12px);
}
[data-theme="light"] .auth-card,
html:not([data-theme]) .auth-card,
[data-theme="system"] .auth-card { border-color: rgba(0,0,0,0.06); }
.auth-title { font-family: 'Inter', sans-serif; font-size: 40px; font-weight: 800; line-height: 1.1; margin: 4px 0 10px; color: var(--white); letter-spacing: -0.01em; }
.auth-title em { color: var(--gold); font-style: italic; }
.auth-sub { color: var(--white2); font-size: 14px; margin: 0 0 26px; line-height: 1.6; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--white2); }
.auth-field input {
  background: var(--navy3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 15px;
  color: var(--white);
  transition: border-color 160ms ease, box-shadow 160ms ease;
  font-family: inherit;
}
[data-theme="light"] .auth-field input,
[data-theme="system"] .auth-field input { border-color: rgba(0,0,0,0.08); }
.auth-field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.auth-error { color: var(--gold); font-size: 13px; margin-top: 2px; }
.auth-error-block { padding: 10px 12px; background: var(--gold-dim); border-radius: 10px; }
.auth-submit { width: 100%; justify-content: center; margin-top: 6px; }
.auth-foot { margin: 22px 0 0; color: var(--white2); font-size: 13px; text-align: center; }
.auth-foot a { color: var(--gold); font-weight: 600; text-decoration: none; }
.auth-flash { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; }
.auth-flash .flash { padding: 10px 14px; border-radius: 10px; font-size: 13px; }
.auth-flash .flash-success { background: rgba(34,197,94,0.14); color: #4ade80; border: 1px solid rgba(34,197,94,0.35); }
.auth-flash .flash-error { background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(230,57,70,0.35); }
.auth-flash .flash-info { background: rgba(56,189,248,0.12); color: #38bdf8; border: 1px solid rgba(56,189,248,0.35); }
.auth-flash .flash-warning { background: rgba(234,179,8,0.14); color: #facc15; border: 1px solid rgba(234,179,8,0.35); }

/* -------- Simple flash strip for other pages -------- */
/* -------- Site-level flash strip (below nav, auto-dismiss) -------- */
.site-flash {
  list-style: none; margin: 0; padding: 0;
  position: fixed; top: 90px; right: 24px; z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 360px; pointer-events: none;
}
.site-flash .flash {
  pointer-events: auto;
  padding: 12px 16px; border-radius: 10px; font-size: 13px; font-weight: 500;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  animation: siteFlashIn .28s ease-out both, siteFlashOut .4s ease-in 4.6s both;
}
@keyframes siteFlashIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes siteFlashOut { to { opacity: 0; transform: translateX(20px); pointer-events: none; } }
.site-flash .flash-success { background: rgba(34,197,94,0.16); color: #4ade80; border-color: rgba(34,197,94,0.35); }
.site-flash .flash-error { background: var(--gold-dim); color: var(--gold); border-color: rgba(230,57,70,0.35); }
.site-flash .flash-info { background: rgba(56,189,248,0.16); color: #38bdf8; border-color: rgba(56,189,248,0.35); }
.site-flash .flash-warning { background: rgba(234,179,8,0.16); color: #facc15; border-color: rgba(234,179,8,0.35); }
@media (max-width: 640px) {
  .site-flash { top: 76px; right: 10px; left: 10px; max-width: none; }
}


/* =========================================================================
   HOME CAROUSEL — sliding banner right below the navbar (public home page)
   ========================================================================= */
.home-carousel {
  position: relative;
  width: 100%;
  margin-top: 76px;            /* clear the fixed 76px navbar */
  overflow: hidden;
  background: var(--navy2);
  aspect-ratio: 16 / 6;        /* wide banner on desktop */
  max-height: 640px;
}
/* If the carousel is present the hero no longer needs its 120px top padding. */
.hero.hero-with-carousel { padding-top: 60px; }

.home-carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}
.home-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, transform 0.7s ease;
  transform: scale(1.02);
  pointer-events: none;
}
.home-carousel-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  pointer-events: auto;
  z-index: 1;
}
.home-carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.home-carousel-slide::after {
  /* subtle bottom vignette so the CTA button always reads on any image */
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.35) 100%);
  z-index: 1;
}
.home-carousel-cta {
  position: absolute;
  left: 8%; bottom: 10%;
  z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(230,57,70,0.35), 0 2px 6px rgba(0,0,0,0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  cursor: none;
}
.home-carousel-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(230,57,70,0.5), 0 3px 8px rgba(0,0,0,0.28);
  filter: brightness(1.05);
}

/* Arrows */
.home-carousel-arrow {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.42);
  color: #fff;
  border-radius: 50%;
  cursor: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(6px);
}
.home-carousel-arrow:hover { background: var(--gold); border-color: var(--gold); transform: translateY(-50%) scale(1.06); }
.home-carousel-prev { left: 18px; }
.home-carousel-next { right: 18px; }

/* Dots */
.home-carousel-dots {
  position: absolute; left: 50%; bottom: 18px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex; gap: 10px;
  padding: 8px 14px;
  background: rgba(0,0,0,0.32);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.home-carousel-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.4);
  cursor: none;
  padding: 0;
  transition: background 0.25s ease, transform 0.25s ease, width 0.25s ease;
}
.home-carousel-dot:hover { background: rgba(255,255,255,0.7); }
.home-carousel-dot.is-active {
  background: var(--gold);
  width: 26px;
  border-radius: 999px;
}

/* Single-slide state — hide navigation controls */
.home-carousel.single-slide .home-carousel-arrow,
.home-carousel.single-slide .home-carousel-dots { display: none; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .home-carousel { aspect-ratio: 16 / 7; }
  .home-carousel-cta { font-size: 14px; padding: 12px 22px; left: 6%; bottom: 12%; }
  .home-carousel-arrow { width: 42px; height: 42px; }
  .home-carousel-prev { left: 12px; }
  .home-carousel-next { right: 12px; }
}
@media (max-width: 768px) {
  /* On phones/tablets, show the FULL image (no crop) — letterbox against the
     dark carousel background if the image's ratio doesn't match the container. */
  .home-carousel { aspect-ratio: 16 / 9; max-height: 520px; background: var(--navy2); }
  .home-carousel-img { object-fit: contain; }
  .home-carousel-slide::after { display: none; }   /* no vignette needed on letterbox */
  .home-carousel-cta { font-size: 13px; padding: 11px 20px; left: 50%; transform: translateX(-50%); bottom: 60px; white-space: nowrap; }
  .home-carousel-arrow { width: 38px; height: 38px; }
  .home-carousel-dots { bottom: 14px; padding: 6px 12px; gap: 8px; }
  .home-carousel-dot { width: 8px; height: 8px; }
  .home-carousel-dot.is-active { width: 22px; }
}
@media (max-width: 480px) {
  .home-carousel { aspect-ratio: 3 / 2; }
  .home-carousel-cta { font-size: 12px; padding: 10px 18px; bottom: 56px; }
  .home-carousel-arrow { width: 34px; height: 34px; border-width: 1px; }
  .home-carousel-prev { left: 8px; }
  .home-carousel-next { right: 8px; }
  .home-carousel-dots { bottom: 12px; padding: 5px 10px; gap: 6px; }
  .home-carousel-dot { width: 7px; height: 7px; }
  .home-carousel-dot.is-active { width: 18px; }
}

/* =========================================================================
   BOOKS PAGE — Grid ↔ Details view toggle
   ========================================================================= */
/* Toggle buttons */
.view-mode-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
  border: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: none;
  transition: color 0.2s ease, background 0.2s ease;
}
.view-mode-btn:hover { color: var(--white); background: var(--navy3); }
.view-mode-btn.is-active {
  background: var(--gold);
  color: #fff;
}
.view-mode-btn.is-active:hover { background: var(--gold2); color: #fff; }
.view-mode-btn + .view-mode-btn { border-left: 1px solid var(--border-line); }

/* Grid mode (default look) */
.books-page-grid.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}
.books-page-grid.view-grid .book-info-details { display: none; }

/* Details mode — clean editorial row with a prominent cover on the left,
   a hierarchical text block and a neat 3-column metadata grid on the right. */
.books-page-grid.view-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
}
.books-page-grid.view-details .book-card {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 26px;
  align-items: start;
  padding: 0;
  overflow: hidden;
  min-height: auto;
  border-radius: 14px;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.books-page-grid.view-details .book-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 18px 42px rgba(0,0,0,0.28);
}
.books-page-grid.view-details .book-cover {
  aspect-ratio: 3 / 4;                /* natural book proportion */
  height: auto;
  min-height: 0;
  max-height: none;
  border-radius: 0;
  border: 0;
  border-right: 1px solid var(--border-line);
}
.books-page-grid.view-details .book-cover .book-icon { font-size: 60px !important; }
.books-page-grid.view-details .book-cover-img { border-radius: 0; }
.books-page-grid.view-details .book-badge { display: none; }

.books-page-grid.view-details .book-info {
  padding: 22px 26px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.books-page-grid.view-details .book-info-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
  letter-spacing: -0.01em;
  -webkit-line-clamp: 2;
  white-space: normal;
  margin-bottom: 2px;
}
.books-page-grid.view-details .book-info-author {
  font-size: 13.5px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 6px;
}
.books-page-grid.view-details .book-info-meta {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 14px;
}
/* metadata grid: 3 columns of key/value pairs on desktop */
.books-page-grid.view-details .book-info-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border-line);
}
.books-page-grid.view-details .book-fact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  color: var(--white);
  font-weight: 600;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}
.books-page-grid.view-details .book-fact .k {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  margin: 0;
}
/* Grid-mode metadata (should stay hidden — safeguard) */
.books-page-grid.view-grid .book-info-details { display: none; }

/* Tablet — 2-col metadata */
@media (max-width: 900px) {
  .books-page-grid.view-details .book-card { grid-template-columns: 140px 1fr; gap: 20px; }
  .books-page-grid.view-details .book-info { padding: 18px 20px 18px 0; }
  .books-page-grid.view-details .book-info-title { font-size: 19px; }
  .books-page-grid.view-details .book-info-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 20px;
  }
}

/* Phone — 2-col metadata, smaller cover, tighter spacing */
@media (max-width: 640px) {
  .books-page-grid.view-details { gap: 12px; }
  .books-page-grid.view-details .book-card { grid-template-columns: 110px 1fr; gap: 14px; }
  .books-page-grid.view-details .book-cover .book-icon { font-size: 40px !important; }
  .books-page-grid.view-details .book-info { padding: 14px 14px 14px 0; }
  .books-page-grid.view-details .book-info-title { font-size: 16px; line-height: 1.3; }
  .books-page-grid.view-details .book-info-author { font-size: 12px; margin-bottom: 4px; }
  .books-page-grid.view-details .book-info-meta { font-size: 10px; letter-spacing: 0.1em; margin-bottom: 10px; }
  .books-page-grid.view-details .book-info-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding-top: 10px;
  }
  .books-page-grid.view-details .book-fact { font-size: 12px; }
  .books-page-grid.view-details .book-fact .k { font-size: 9px; letter-spacing: 0.1em; }
  .view-mode-btn span { display: none; }
  .view-mode-btn { padding: 9px 12px; }
}

/* Very small phones — 2-col metadata, tightest cover */
@media (max-width: 420px) {
  .books-page-grid.view-details .book-card { grid-template-columns: 92px 1fr; gap: 12px; }
  .books-page-grid.view-details .book-info-details {
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
  }
}

