@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Lobster';
  src: url('fonts/lobster-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --t: 0.3s cubic-bezier(.4, 0, .2, 1);
  --spring: 0.5s cubic-bezier(.175, .885, .32, 1.275);
  --star-color: #F59E0B;
}

[data-theme="dark"] {
  --bg: #111110;
  --surface: #1C1C1A;
  --surface-elevated: #252523;
  --text: #F0EFE9;
  --text-secondary: #9A9891;
  --muted: #8A8883;
  --border: rgba(255, 255, 255, 0.07);
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  --shadow-h: 0 12px 40px rgba(0, 0, 0, 0.5);
  --nav-bg: rgba(17, 17, 16, 0.88);
  --accent: #10B981;
  --accent-soft: rgba(16, 185, 129, 0.12);
  --accent-glow: rgba(16, 185, 129, 0.22);
  --card-bg: rgba(28, 28, 26, 0.7);
  --card-border: rgba(255, 255, 255, 0.05);
  --card-hover-border: rgba(16, 185, 129, 0.35);
  --aurora-1: rgba(16, 185, 129, 0.26);
  --aurora-2: rgba(94, 92, 230, 0.22);
  --aurora-3: rgba(255, 159, 10, 0.18);
  --grain-opacity: 0.022;
}

[data-theme="light"] {
  --bg: #E8EDE6;
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --text: #161614;
  --text-secondary: #6A6865;
  --muted: #888580;
  --border: rgba(0, 0, 0, 0.09);
  --shadow: 0 2px 20px rgba(0, 0, 0, 0.09);
  --shadow-h: 0 10px 40px rgba(0, 0, 0, 0.16);
  --nav-bg: rgba(232, 237, 230, 0.94);
  --accent: #059669;
  --accent-soft: rgba(5, 150, 105, 0.1);
  --accent-glow: rgba(5, 150, 105, 0.2);
  --card-bg: #FFFFFF;
  --card-border: rgba(0, 0, 0, 0.08);
  --card-hover-border: rgba(5, 150, 105, 0.45);
  --aurora-1: rgba(16, 185, 129, 0.35);
  --aurora-2: rgba(94, 92, 230, 0.25);
  --aurora-3: rgba(255, 159, 10, 0.22);
  --grain-opacity: 0.012;
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Helvetica, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  transition: background var(--t), color var(--t);
}

/* ── AURORA BACKGROUND ── */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.aurora {
  position: absolute;
  filter: blur(80px);
}

.aurora-1 {
  width: 650px; height: 500px;
  border-radius: 42% 58% 65% 35% / 55% 40% 60% 45%;
  background: var(--aurora-1);
  top: -200px; right: -150px;
  opacity: 0.6;
  animation: auroraMove1 28s ease-in-out infinite, auroraBreathe1 7s ease-in-out 3s infinite backwards;
}

.aurora-2 {
  width: 550px; height: 450px;
  border-radius: 65% 35% 40% 60% / 45% 60% 40% 55%;
  background: var(--aurora-2);
  bottom: -150px; left: -100px;
  opacity: 0.4;
  animation: auroraMove2 34s ease-in-out infinite, auroraBreathe2 9s ease-in-out 3.5s infinite backwards;
}

.aurora-3 {
  width: 400px; height: 350px;
  border-radius: 55% 45% 50% 50% / 40% 55% 45% 60%;
  background: var(--aurora-3);
  top: 35%; left: 45%;
  opacity: 0.5;
  animation: auroraMove3 24s ease-in-out infinite, auroraBreathe3 11s ease-in-out 4s infinite backwards;
}

.aurora-4 {
  width: 350px; height: 400px;
  border-radius: 40% 60% 55% 45% / 60% 35% 65% 40%;
  background: var(--aurora-2);
  top: 10%; left: -80px;
  opacity: 0.4;
  animation: auroraMove4 38s ease-in-out infinite, auroraBreathe2 8s ease-in-out 4.5s infinite backwards;
}

.aurora-5 {
  width: 300px; height: 280px;
  border-radius: 58% 42% 48% 52% / 50% 62% 38% 50%;
  background: var(--aurora-1);
  bottom: 15%; right: -60px;
  opacity: 0.6;
  animation: auroraMove5 32s ease-in-out infinite, auroraBreathe1 10s ease-in-out 5s infinite backwards;
}

@keyframes auroraBreathe1 { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes auroraBreathe2 { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.85; } }
@keyframes auroraBreathe3 { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.9; } }

@keyframes auroraMove1 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  25% { transform: translate(-80px, 60px) scale(1.08) rotate(3deg); }
  50% { transform: translate(-30px, 120px) scale(0.95) rotate(-2deg); }
  75% { transform: translate(50px, 40px) scale(1.05) rotate(1deg); }
}
@keyframes auroraMove2 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  25% { transform: translate(60px, -80px) scale(1.06) rotate(-3deg); }
  50% { transform: translate(100px, -30px) scale(0.97) rotate(2deg); }
  75% { transform: translate(30px, -60px) scale(1.03) rotate(-1deg); }
}
@keyframes auroraMove3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  33% { transform: translate(-40%, -55%) scale(1.12) rotate(4deg); }
  66% { transform: translate(-55%, -42%) scale(0.92) rotate(-3deg); }
}
@keyframes auroraMove4 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  30% { transform: translate(40px, 80px) scale(1.1) rotate(-4deg); }
  60% { transform: translate(80px, 30px) scale(0.94) rotate(3deg); }
}
@keyframes auroraMove5 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  35% { transform: translate(-50px, -60px) scale(1.08) rotate(5deg); }
  70% { transform: translate(-20px, 40px) scale(0.96) rotate(-2deg); }
}

.bg-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* ── NAVBAR ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 52px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--border);
  transition: background var(--t);
}

.nav-logo {
  font-family: 'Lobster', cursive;
  font-size: 1.5rem;
  color: var(--accent);
  text-decoration: none;
}
.nav-logo-img { height: 24px; width: auto; display: block !important; }
.nav-logo-img-light { height: 24px; width: auto; display: none !important; }
[data-theme="light"] .nav-logo-img { display: none !important; }
[data-theme="light"] .nav-logo-img-light { display: block !important; }

.nav-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  transition: background 0.2s;
}
.theme-btn:hover { background: var(--accent-soft); }

.icon-sun, .icon-moon {
  position: absolute;
  width: 17px; height: 17px;
  transition: opacity 0.3s, transform 0.4s cubic-bezier(.4, 0, .2, 1);
  color: var(--muted);
}
[data-theme="dark"] .icon-sun { opacity: 0; transform: rotate(45deg) scale(0.6); }
[data-theme="dark"] .icon-moon { opacity: 1; transform: none; }
[data-theme="light"] .icon-sun { opacity: 1; transform: none; }
[data-theme="light"] .icon-moon { opacity: 0; transform: rotate(-45deg) scale(0.6); }

.lang-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  touch-action: manipulation;
  transition: background 0.2s, color 0.2s;
}
.lang-btn:hover { background: var(--accent-soft); color: var(--text); }

/* ── CONTAINER ── */
.container {
  position: relative;
  z-index: 2;
  max-width: 960px;
  margin: 0 auto;
  padding: 110px 24px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── HERO ── */
.hero {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeUp 0.9s cubic-bezier(.22, .68, 0, 1) both;
}

.site-title {
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #059669 0%, #059669 30%, #a7f3d0 50%, #059669 70%, #059669 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: nameShimmer 8s ease-in-out infinite;
}

@keyframes nameShimmer {
  0%, 100% { background-position: 100% 50%; }
  50% { background-position: 0% 50%; }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 100px;
  background: var(--accent-soft);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 14px 0 12px;
  transition: background var(--t), border-color var(--t);
}

[data-theme="light"] .hero-badge {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(5, 150, 105, 0.25);
  color: #059669;
}

.tagline {
  font-size: 17px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: -0.01em;
  transition: color var(--t);
}

.hero-line {
  width: 36px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--accent);
  margin: 28px auto 0;
  opacity: 0.6;
}

/* ── FILTER BAR ── */
.filter-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  animation: fadeUp 0.9s cubic-bezier(.22, .68, 0, 1) 0.1s both;
}

.filter-categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.filter-btn:hover { border-color: var(--card-hover-border); color: var(--text); }
.filter-btn.active {
  background: var(--accent-soft);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--accent);
}

.filter-sort {
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238A8883' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  transition: all 0.2s;
}
.filter-sort:hover { border-color: var(--card-hover-border); color: var(--text); }

/* ── BOOK COUNT ── */
.book-count {
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-left: 4px;
  margin-bottom: 16px;
  transition: color var(--t);
}

/* ── BOOK GRID ── */
.book-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* ── BOOK CARD ── */
.book-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: saturate(150%) blur(20px);
  -webkit-backdrop-filter: saturate(150%) blur(20px);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition:
    transform 0.4s cubic-bezier(.22, .68, 0, 1),
    box-shadow 0.4s cubic-bezier(.22, .68, 0, 1),
    border-color 0.3s ease,
    background var(--t);
}

.book-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    var(--accent-soft) 0%, transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}
.book-card:hover::before { opacity: 1; }
.book-card:hover {
  transform: translateY(-2px) scale(1.005);
  box-shadow: var(--shadow-h);
  border-color: var(--card-hover-border);
}
.book-card:active {
  transform: translateY(-1px) scale(1.002);
}

[data-theme="light"] .book-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.book-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 24px;
}

.book-cover {
  max-width: 55%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s cubic-bezier(.22, .68, 0, 1);
}
.book-card:hover .book-cover { transform: scale(1.03); }

.book-cover-wrap::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--card-bg));
  pointer-events: none;
}

.book-info {
  padding: 14px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 2;
}

.book-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text);
}

.book-author {
  font-size: 13px;
  color: var(--muted);
  transition: color var(--t);
}

.book-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--card-border);
}

.book-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--star-color);
}
.book-rating svg { flex-shrink: 0; }

.book-tag {
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: background var(--t), color var(--t);
}

/* ── BOOK DETAIL OVERLAY ── */
.book-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: background 0.4s ease;
  pointer-events: none;
}
.book-overlay.visible {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
}

.book-detail {
  max-width: 680px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(.22, .68, 0, 1);

  /* Book-style: cream-tinted surface, spine shadow, page edges */
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  box-shadow:
    0 -8px 40px rgba(0, 0, 0, 0.35),
    inset 4px 0 12px -4px rgba(0, 0, 0, 0.15);
}
.book-overlay.visible .book-detail {
  transform: translateY(0);
}

/* Drag handle */
.detail-handle {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
  cursor: grab;
}
.detail-handle::before {
  content: '';
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--muted);
  opacity: 0.3;
}

/* Inner padding wrapper */
.detail-body {
  padding: 8px 32px 40px;
}

/* Book spine accent — decorative left border */
.detail-body::before {
  content: '';
  position: absolute;
  top: 56px;
  left: 0;
  width: 4px;
  height: calc(100% - 72px);
  background: linear-gradient(to bottom, var(--accent), rgba(16, 185, 129, 0.15));
  border-radius: 0 2px 2px 0;
}

.detail-close {
  position: absolute;
  top: 16px; right: 20px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent-soft);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.2s, transform 0.2s;
  z-index: 1;
}
.detail-close:hover { background: var(--accent-glow); transform: scale(1.05); }

/* Cover centered at top */
.detail-cover-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.detail-cover {
  width: 160px;
  border-radius: 6px;
  object-fit: contain;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.35),
    4px 0 8px -2px rgba(0, 0, 0, 0.2),
    -1px 0 3px rgba(0, 0, 0, 0.1);
}

/* Title block */
.detail-title-block {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

.detail-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 4px;
}

.detail-author {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
  font-style: italic;
}

.detail-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Chapter-like section headers */
.detail-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

.detail-review {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 32px;
}

/* First letter drop cap — book feel */
.detail-review::first-letter {
  font-size: 2.4em;
  font-weight: 700;
  float: left;
  line-height: 1;
  margin-right: 6px;
  margin-top: 2px;
  color: var(--accent);
}

.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.buy-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: opacity 0.2s, transform 0.2s;
  flex: 1;
  justify-content: center;
  min-width: 120px;
}
.buy-link:hover { opacity: 0.85; transform: translateY(-1px); }

.buy-link.amazon {
  background: var(--accent);
  color: #fff;
}
.buy-link.kindle {
  background: var(--surface-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}
.buy-link.audible {
  background: var(--surface-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.affiliate-note {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.5;
  line-height: 1.5;
  text-align: center;
}

/* ── FOOTER ── */
.footer {
  margin-top: auto;
  padding-top: 64px;
  padding-bottom: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-links a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.01em;
  font-weight: 400;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text); }

.footer-dot {
  width: 2px; height: 2px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.35;
}

.footer-copy {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.01em;
  opacity: 0.5;
  font-weight: 400;
  transition: color var(--t);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(.22,.68,0,1), transform 0.7s cubic-bezier(.22,.68,0,1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .container {
    max-width: 100%;
    padding: 88px 20px max(48px, env(safe-area-inset-bottom, 24px));
  }
  .book-grid { gap: 14px; }
  .detail-body { padding: 8px 24px 32px; }
  .detail-cover { width: 140px; }
}

@media (max-width: 480px) {
  nav {
    padding: 0 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .container {
    padding: 80px 16px max(40px, env(safe-area-inset-bottom, 20px));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .book-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .book-card { border-radius: 16px; }
  .book-cover-wrap { padding: 16px; }
  .book-info { padding: 10px 14px 14px; }
  .book-title { font-size: 13px; }
  .book-author { font-size: 11px; }
  .book-meta { padding-top: 6px; margin-top: 6px; }
  .book-rating { font-size: 11px; }
  .book-tag { font-size: 10px; padding: 2px 8px; }

  .book-detail { max-height: 95vh; border-radius: 20px 20px 0 0; }
  .detail-body { padding: 8px 20px 32px; }
  .detail-cover { width: 120px; }
  .detail-title { font-size: 18px; }
  .detail-body::before { top: 48px; }
  .buy-link { padding: 11px 16px; font-size: 12px; min-width: 0; }

  .filter-bar { gap: 10px; }
  .filter-categories { gap: 6px; }
  .filter-btn { padding: 5px 10px; font-size: 11px; }

  .aurora { filter: blur(60px); }
  .aurora-1 { width: 350px; height: 280px; }
  .aurora-2 { width: 300px; height: 250px; }
  .aurora-3 { width: 220px; height: 200px; }
  .aurora-4 { width: 200px; height: 220px; }
  .aurora-5 { width: 180px; height: 160px; }
}

@media (max-width: 360px) {
  .container { padding-left: 12px; padding-right: 12px; }
  .book-grid { gap: 10px; }
  .book-info { padding: 8px 12px 12px; }
}

/* ── TOUCH DEVICE ── */
@media (hover: none) {
  .book-card:hover {
    transform: none;
    box-shadow: var(--shadow);
    border-color: var(--card-border);
  }
  .book-card:hover::before { opacity: 0; }
  .book-card:hover .book-cover { transform: none; }

  .book-card:active {
    transform: scale(0.98);
    opacity: 0.85;
    transition: transform 0.1s ease, opacity 0.1s ease;
  }

  .theme-btn:hover, .lang-btn:hover { background: transparent; }
  .theme-btn:active, .lang-btn:active {
    transform: scale(0.9);
    opacity: 0.7;
    transition: transform 0.1s ease, opacity 0.1s ease;
  }
}

/* ── ACCESSIBILITY ── */
.book-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-btn:focus-visible, .lang-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.detail-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(16, 185, 129, 0.2); color: var(--text); }
