/* ═══════════════════════════════════════════════════════
   NOIR BOOKS — Film Noir Theme
   ═══════════════════════════════════════════════════════ */

:root {
  /* Palette */
  --noir-bg: #0a0a0a;
  --noir-surface: #1a1a1a;
  --noir-surface-hover: #242424;
  --noir-accent: #c9a84c;
  --noir-accent-dim: #8a7434;
  --noir-text: #e8e8e8;
  --noir-muted: #888888;
  --noir-danger: #8b3a3a;
  --noir-success: #4a7a4a;

  /* Typography */
  --noir-font-heading: 'Playfair Display', Georgia, serif;
  --noir-font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --noir-radius: 4px;
  --noir-shadow: 4px 8px 24px rgba(0, 0, 0, 0.8);
  --noir-shadow-hover: 6px 12px 32px rgba(0, 0, 0, 0.9);
  --noir-glow: 0 0 12px rgba(201, 168, 76, 0.4);

  /* Transitions */
  --noir-transition: 0.3s ease;

  /* Safe area convenience variables */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Eliminate 300ms tap delay on touch devices */
button, a, [role="button"] {
  touch-action: manipulation;
}

html, body {
  height: 100%;
  background-color: var(--noir-bg);
  color: var(--noir-text);
  font-family: var(--noir-font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prevent iOS input zoom — font-size must be >= 16px on all inputs */
input, textarea, select {
  font-size: max(1rem, 16px);
}

/* Film Grain Overlay */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--noir-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--noir-muted);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--noir-accent);
}

/* Page transition utility */
.page-enter {
  animation: fadeIn var(--noir-transition) forwards;
}

.page-exit {
  animation: fadeOut 0.2s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Loading shimmer */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--noir-surface) 25%, var(--noir-surface-hover) 50%, var(--noir-surface) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--noir-radius);
}

