:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #252525;
  --amber: #d4a843;
  --amber-dark: #a37e2c;
  --amber-light: #e8c96a;
  --text-primary: #f0ece2;
  --text-secondary: #a09a8c;
  --text-muted: #6b6558;
  --border-dark: #333;
  --film-border: #2a2a2a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Archivo', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Film grain overlay */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  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)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}

.font-bebas { font-family: 'Bebas Neue', cursive; }
.font-mono { font-family: 'IBM Plex Mono', monospace; }
.font-archivo { font-family: 'Archivo', sans-serif; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--text-muted);
  border-radius: 8px;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--amber);
  box-shadow: 0 0 30px rgba(212, 168, 67, 0.15), inset 0 0 30px rgba(212, 168, 67, 0.05);
}

.upload-zone::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 20px rgba(212, 168, 67, 0);
  transition: box-shadow 0.4s ease;
  pointer-events: none;
}

.upload-zone:hover::after {
  box-shadow: inset 0 0 20px rgba(212, 168, 67, 0.08);
}

/* Generate button */
.btn-generate {
  background: linear-gradient(135deg, var(--amber-dark), var(--amber), var(--amber-light));
  color: #1a1a1a;
  font-weight: 900;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-generate:hover:not(:disabled) {
  box-shadow: 0 0 40px rgba(212, 168, 67, 0.3);
  transform: translateY(-1px);
}

.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-generate::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.btn-generate:hover:not(:disabled)::before {
  transform: translateX(100%);
}

/* Grid panel */
.shot-panel {
  position: relative;
  background: #111;
  border: 2px solid var(--film-border);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.shot-panel:hover {
  transform: scale(1.02);
  border-color: var(--amber-dark);
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.15);
  z-index: 10;
}

/* Panel vignette */
.shot-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 2;
}

/* Sprocket holes */
.sprocket-hole {
  width: 12px;
  height: 18px;
  border-radius: 3px;
  background: var(--bg-primary);
  border: 1px solid #333;
}

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

.shimmer-bg {
  background: linear-gradient(
    90deg,
    #1a1a1a 25%,
    #2a2a2a 50%,
    #1a1a1a 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite linear;
}

/* Fade in animation */
@keyframes fadeInPanel {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.panel-fade-in {
  animation: fadeInPanel 0.5s ease forwards;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

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

/* Style preset pills */
.style-pill {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-dark);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  white-space: nowrap;
}

.style-pill:hover {
  border-color: var(--amber-dark);
  color: var(--text-primary);
}

.style-pill.active {
  border-color: var(--amber);
  background: rgba(212, 168, 67, 0.15);
  color: var(--amber);
}

/* How it works */
.how-it-works-toggle {
  cursor: pointer;
  transition: color 0.2s;
}

.how-it-works-toggle:hover {
  color: var(--amber);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* Responsive */
@media (max-width: 768px) {
  .sprocket-column { display: none !important; }
}

/* Progress bar */
@keyframes progressPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.progress-pulse {
  animation: progressPulse 1.5s ease infinite;
}

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  animation: spin 1s linear infinite;
}